You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(py_wheel): Normalize name and version (#1331)
Added the `incompatible_normalize_name` feature flag to normalize the
package distribution name according to latest Python packaging
standards. Defaults to `False` for the time being.
Added the `incompatible_normalize_version` feature flag to normalize the
package version according to PEP440 standard. This also adds support for
local version specifiers (versions with a `+` in them), in accordance
with PEP440. Defaults to `False` for the time being.
Instead of following the obsolete PEP 427 escaping procedure for
distribution names and versions, we should use the rules specified by
https://packaging.python.org/en/latest/specifications (sections "Package
name normalization" and "Binary distribution format"). For the versions,
this means normalizing them according to PEP 440.
Added as feature flags to avoid forcing the user to deal with breaking
changes when upgrading `rules_python`:
- Distribution names have stronger requirements now: "A valid name
consists only of ASCII letters and numbers, period, underscore and
hyphen. It must start and end with a letter or number."
https://packaging.python.org/en/latest/specifications/name-normalization/
- Versions must be valid PEP 440 version identifiers. Previously
versions such as "0.1-2-3" would have been accepted; that is no longer
the case.
- The file name of generated wheels may have changed, if the
distribution name or the version identifier wasn't in normalized form.
- The wheelmaker now depends on `packaging.version`, which means the
`py_wheel` user now needs to load pip dependencies in their
`WORKSPACE.bazel` file:
```
load("@rules_python//python/pip_install:repositories.bzl",
"pip_install_dependencies")
pip_install_dependencies()
```
Fixes#883. Fixes#1132.
---------
Co-authored-by: Ignas Anikevicius <[email protected]>
Co-authored-by: Ignas Anikevicius <[email protected]>
0 commit comments