Skip to content

Conversation

@SyedaAnshrahGillani
Copy link

This pull request addresses a TODO in prelude/python/tools/wheel.py to normalize the package version.

The WheelBuilder class was using the version string as-is, without any normalization. This could
lead to inconsistencies in the generated wheel metadata.

This change introduces a normalize_version function that canonicalizes the version string according
to a simplified subset of the PEP 440 standard. This ensures that the version in the METADATA file
is always in a consistent and predictable format.

@facebook-github-bot
Copy link
Contributor

Hi @SyedaAnshrahGillani!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 29, 2025
@alexlian alexlian added python Python prelude prelude Related to integration/prelude labels Jun 29, 2025
@alexlian alexlian requested a review from zsol June 29, 2025 22:36
@zsol
Copy link
Contributor

zsol commented Jun 29, 2025

Thanks for this! I think an incomplete implementation of the spec would be OK, but unfortunately this is incorrect, because this implementation replaces all separators with ., but that's not a valid normalization of pre-release separators.
Concretely, normalizing 1.1-a1 should result in 1.1a1 but this code produces 1.1.a1

There's an implementation of the spec in the packaging package, which we might be able to vendor.

@facebook-github-bot
Copy link
Contributor

@facebook-github-bot has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. (Because this pull request was imported automatically, there will not be any future comments.)

@BrandonTheBuilder
Copy link
Contributor

packaging is not included in the python standard library and since python_wheel is built using a python_bootstrap_binary rule it does not have access to third-party dependencies

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. prelude Related to integration/prelude python Python prelude

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants