Skip to content
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

fix(pypi): handle multiple versions of the same package when parsing requirements files #2377

Merged
merged 2 commits into from
Nov 18, 2024

Conversation

ewianda
Copy link
Contributor

@ewianda ewianda commented Nov 6, 2024

This change makes it possible to handle local versions of packages,
which is extremely useful with PyTorch. With this change, it is
possible to have different local versions of the same package in the
requirements.txt file translated to valid whl_library repositories.

Fixes #2337

@ewianda ewianda force-pushed the feat-pip-parse-handle-local-versions branch 4 times, most recently from 3e05fbf to 3002d39 Compare November 15, 2024 18:20
@ewianda ewianda marked this pull request as ready for review November 15, 2024 21:13
Copy link
Collaborator

@aignas aignas left a 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.

python/private/pypi/parse_requirements.bzl Outdated Show resolved Hide resolved
python/private/pypi/parse_requirements.bzl Outdated Show resolved Hide resolved
python/private/pypi/parse_requirements.bzl Outdated Show resolved Hide resolved
@ewianda ewianda force-pushed the feat-pip-parse-handle-local-versions branch from 3002d39 to 273b162 Compare November 16, 2024 16:41
@ewianda
Copy link
Contributor Author

ewianda commented Nov 16, 2024

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.

Yes that is correct

@aignas aignas changed the title feat(pypi) Handle local version in requirement parsing fix(pypi): handle multiple versions of the same package when parsing requirements files Nov 18, 2024
@aignas
Copy link
Collaborator

aignas commented Nov 18, 2024

I have reworded the commit message a little bit and changed the title since this is more like a fix to an existing feature rather than a new featuer.

LGTM in general, could you please add a CHANGELOG.md note as well that this PR fixes an open issue? Something like:

  • (pypi): Correctly handle multiple versions of the same package in the requirements files which is useful when including different PyTorch builds (e.g. <pytorch+cpu> vs ) for different target platforms. Fixes #2337.

@ewianda ewianda force-pushed the feat-pip-parse-handle-local-versions branch from 273b162 to 23e7f7f Compare November 18, 2024 01:28
Copy link
Collaborator

@aignas aignas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, could you please move the changelog entry to the unreleased block? It might have messed up during a merge/rebase.

@ewianda ewianda force-pushed the feat-pip-parse-handle-local-versions branch from 8653c45 to 06cfc3c Compare November 18, 2024 02:35
@ewianda ewianda requested a review from aignas November 18, 2024 02:40
@aignas aignas added this pull request to the merge queue Nov 18, 2024
Merged via the queue into bazelbuild:main with commit f88e083 Nov 18, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pip.parse doesn't fetch anything with conflicting markers
2 participants