Skip to content

fix: escape name segment of stamped wheel files #2741

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mattem
Copy link
Contributor

@mattem mattem commented Apr 5, 2025

~1 year ago py_wheel changed to enforce PEP440, however the resulting stamp vars are no longer escaped.

For example:
Before: bazel-bin/xxxx/xxxx-_STABLE_BUILD_SCM_VERSION_-py3-none-any.whl
After: bazel-bin/xxxx/xxxx-{STABLE_BUILD_SCM_VERSION}-py3-none-any.whl

This results in downstream consumers of the wheel that are publishing, or generating "manifest" stye files of release artifacts and other metadata will now incorrectly replace the {STABLE_BUILD_SCM_VERSION} in the artifact name and path, leading to the incorrect artifact metadata and pathing.

Original reported here, however this could be seen as breaking, as it changes the unstamped wheel file names.
https://bazelbuild.slack.com/archives/C0174UDLAF3/p1706726049830819

@mattem mattem requested review from rickeylev and aignas as code owners April 5, 2025 19:04
@mattem mattem force-pushed the fix/escape_pywheel_name_segment branch from 6bc8b25 to 1856170 Compare April 5, 2025 21:57
@@ -440,7 +440,7 @@ def test_rule_creates_directory_and_is_included_in_wheel(self):

def test_rule_expands_workspace_status_keys_in_wheel_metadata(self):
filename = self._get_path(
"example_minimal_library{BUILD_USER}-0.1.{BUILD_TIMESTAMP}-py3-none-any.whl"
"example_minimal_library{BUILD_USER}-0.1._BUILD_TIMESTAMP_-py3-none-any.whl"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The distribution likely needs escaping too.

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.

1 participant