Using pip or packaging for wildcard version matching#465
Open
mkb79 wants to merge 2 commits intoywangd:devfrom
Open
Using pip or packaging for wildcard version matching#465mkb79 wants to merge 2 commits intoywangd:devfrom
mkb79 wants to merge 2 commits intoywangd:devfrom
Conversation
`packaging` or `pip` must be installed for this. With these changes wildcard versions lile '==1.*' can be matched.
cclauss
requested changes
Jan 30, 2023
| if HAS_SPECIFIER: | ||
| try: | ||
| self.specifier = SpecifierSet(''.join(version_specs[0])) | ||
| except: |
Collaborator
There was a problem hiding this comment.
Do not use bare except:, it also catches unexpected events like memory errors, interrupts, system exit, and so on.
| if self.specifier is not None: | ||
| try: | ||
| return self.specifier.contains(version) | ||
| except: |
| else: | ||
| if not op(vi, evi): | ||
| matches = False | ||
| return matches |
Collaborator
There was a problem hiding this comment.
Add a blank line at the end of the file (as discussed in PEP8) to avoid the ⛔ below in the GitHub file viewer.
cclauss
reviewed
May 4, 2023
Collaborator
|
Please git rebase. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With these changes wildcard versions lile '==1.*' can be matched.
IMPORTANT:
packagingorpipmust be installed for this.