semver/pep508: handle wildcard exclusions#343
Conversation
|
@radoering since you looked at the last semver fix; can you take a peek here too? |
radoering
left a comment
There was a problem hiding this comment.
Seems a bit cumbersome indeed, but since I have no better approach I think it's fine for now with some minor changes.
43d5d27 to
663c54d
Compare
ecd9435 to
00193c8
Compare
There was a problem hiding this comment.
Wow, definitively more extensive than I would have expected. But since it is encapsulated in its own method and you already know the goal of the long else branch after reading the short if branch it is not that difficult to follow. And since the test coverage seems fine, I'm fine with it for now.
Just two minor nitpicks (see comments).
00193c8 to
acb2336
Compare
Prior to this change, when exporting PEP 508 strings for dependencies, wildcard exclusion constraints like `!=2.0.*` were incorrectly serialised as invalid PEP 508 due to how version unions were serialsed. This change allows for determining if a version union is a single wildcard range exclusion, and if so serialise it appropriately. Resolves: python-poetry/poetry#5470
acb2336 to
2875257
Compare
|
Kudos, SonarCloud Quality Gate passed!
|
Prior to this change, when exporting PEP 508 strings for dependencies, wildcard exclusion constraints like `!=2.0.*` were incorrectly serialised as invalid PEP 508 due to how version unions were serialised. This change allows for determining if a version union is a single wildcard range exclusion, and if so serialise it appropriately. Resolves: python-poetry/poetry#5470
Prior to this change, when exporting PEP 508 strings for dependencies, wildcard exclusion constraints like `!=2.0.*` were incorrectly serialised as invalid PEP 508 due to how version unions were serialised. This change allows for determining if a version union is a single wildcard range exclusion, and if so serialise it appropriately. Resolves: python-poetry/poetry#5470








Prior to this change, when exporting PEP 508 strings for dependencies, wildcard exclusion constraints like
!=2.0.*were incorrectly serialised as invalid PEP 508 due to how version unions were serialsed.This change allows for determining if a version union is a single wildcard range exclusion, and if so serialise it appropriately.
Resolves: python-poetry/poetry#5470
PS: Not entirely sure if this is the best fix, but it does the trick for now. Not entirely happy with the determination logic, if anyone has a better approach please do share.
Additionally, during testing it was identified that the
X_CONSTRAINTpattern mattaching when parsing constraints ignores any non semver versions (eg: calver). While the parser is in the "semver" package, since Poetry needs to support PEP440 based constraints, this should be improved. Will propose a fix in another PR.