Description
I have a request to add support for workspace status keys expansion for distribution attribute in py_wheel.
We would like to use workspace status keys in distribution similar to the version in py_wheel.
Example:
py_wheel(
name = "pywheel",
author = "ABC",
author_email = "abc@xyz.com",
distribution = "test{DIST_VARIABLE}",
homepage = "https://www.xyz.com",
license = "Proprietary",
python_tag = "py3",
requires = some_variable,
version = "{VARIABLE_VERSION}",
deps = [
"//xyz:pylibrary",
],
)
Currently, distribution does not support passing a workspace status key like {DIST_VARIABLE}.
distribution = "test{DIST_VARIABLE}",
Note: This would be an important feature for us as we move ahead with using Bazel in our Python projects.
Our goal is to dynamically determine the distribution attribute in the py_wheel rule within the BUILD.bazel file of our repositories, depending on the branch in the source code's version control system (Git).
We aim to seamlessly support both feature and release branches without the necessity of modifying the py_wheel file every time the code transitions between different branch types. To achieve this, we plan to utilize workspace status to identify the branch name and determine a DISTRIBUTION_SUFFIX accordingly.
The reason for manipulating the distribution is rooted in the behavior of tools like pip-compile, which determine version compatibility and replacements. If we don't modify the distribution, which represents the library name, builds from main, release, and feature branches will be merged into a single update stream.