Skip to content

Commit

Permalink
fix(poetry): Fix range unions (#6587)
Browse files Browse the repository at this point in the history
  • Loading branch information
zharinov committed Jun 25, 2020
1 parent 0c06a23 commit 7f5ce43
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions lib/versioning/poetry/index.spec.ts
Expand Up @@ -457,4 +457,14 @@ describe('semver.getNewValue()', () => {
})
).toEqual('~2');
});
it('widens range', () => {
expect(
semver.getNewValue({
currentValue: '^2.2',
rangeStrategy: 'widen',
fromVersion: '2.2.0',
toVersion: '3.0.0',
})
).toEqual('^2.2 || ^3.0.0');
});
});
2 changes: 1 addition & 1 deletion lib/versioning/poetry/index.ts
Expand Up @@ -40,7 +40,7 @@ function npm2poetry(input: string): string {
res.splice(i, 2, newValue);
}
}
return res.join(', ');
return res.join(', ').replace(/\s*,?\s*\|\|\s*,?\s*/, ' || ');
}

const isLessThanRange = (version: string, range: string): boolean =>
Expand Down

0 comments on commit 7f5ce43

Please sign in to comment.