fix(pypi): use local version specifiers for patched whl output#2365
Merged
aignas merged 3 commits intobazel-contrib:mainfrom Nov 4, 2024
Merged
fix(pypi): use local version specifiers for patched whl output#2365aignas merged 3 commits intobazel-contrib:mainfrom
aignas merged 3 commits intobazel-contrib:mainfrom
Conversation
Before this change the installation of the patched wheels using `uv` or similar would break. This change fixes that by using local version specifier, which is better than using a build tag when installing the wheels. Before the change: ```console $ cd examples/bzlmod $ bazel build @pip//requests:whl $ uv pip install <path to requests wheel in the example> error: The wheel filename "requests-2.25.1-patched-py2.py3-none-any.whl" has an invalid build tag: must start with a digit ``` After: ``` $ uv pip install <path to requests wheel in the example> Resolved 5 packages in 288ms Prepared 5 packages in 152ms Installed 5 packages in 13ms + certifi==2024.8.30 + chardet==4.0.0 + idna==2.10 + requests==2.25.1+patched (from file:///home/aignas/src/github/aignas/rules_python/examples/bzlmod/bazel-bzlmod/external/rules_python~~pip~pip_39_requests_py2_none_any_c210084e/requests-2.25.1+patched-py2.py3-none-any.whl) + urllib3==1.26.20 ```
groodt
reviewed
Nov 4, 2024
| ([617](https://github.com/bazelbuild/rules_python/issues/617)). | ||
| * (pypi) When {attr}`pip.parse.experimental_index_url` is set, we need to still | ||
| pass the `extra_pip_args` value when building an `sdist`. | ||
| * (pypi) The patched wheel filenames from now on are using local version specifiers |
Collaborator
There was a problem hiding this comment.
Suggested change
| * (pypi) The patched wheel filenames from now on are using local version specifiers | |
| * (pypi) The patched wheel filenames from now on are using local version identifiers |
Alternative suggestion for full CHANGELOG entry:
(pypi) Patched wheel filenames use local version identifiers to enable installation with standards-compliant package managers
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.
Before this change the installation of the patched wheels using
uvorsimilar would break. This change fixes that by using local version
specifier, which is better than using a build tag when installing the
wheels.
Before the change:
After: