-
Notifications
You must be signed in to change notification settings - Fork 541
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
feat(pypi) Handle local version in requirement parsing #2377
base: main
Are you sure you want to change the base?
feat(pypi) Handle local version in requirement parsing #2377
Conversation
69fd075
to
3e05fbf
Compare
3e05fbf
to
3002d39
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.
Thanks for the contribution!
Does this fix the #2337 issue? Looking at the fix here this may be the case, but I am not sure.
version_start = entry.find("==") | ||
if version_start != -1: | ||
# Extract everything after '==' until the next space or end of the string | ||
version = entry[version_start + 2:].split(" ")[0] |
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.
nit: I prefer using partition
in the code because it just creates three return values.
version = entry[version_start + 2:].split(" ")[0] | |
version, _, _ = entry[version_start + 2:].partition(" ") |
|
||
entry: The requirement string. |
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.
entry: The requirement string. | |
Args: | |
entry: {type}`str` The requirement string. |
normalize_name(entry[0]): entry | ||
(entry[0], _extract_version(entry[1])): entry |
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.
You are dropping the normalize_name
here, could we keep it here please?
This change makes it possible to handle local versions of packages, especially pytorch. With this change, it is possible to have different versions of the same package