-
Notifications
You must be signed in to change notification settings - Fork 251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
semver/pep508: handle wildcard exclusions #343
semver/pep508: handle wildcard exclusions #343
Conversation
@radoering since you looked at the last semver fix; can you take a peek here too? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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! 0 Bugs No Coverage information |
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_CONSTRAINT
pattern 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.