Skip to content

Conversation

sfc-gh-wzhao
Copy link
Contributor

Currently, if extra requirements are provided via a file, it is allowed to contain markers, but if it is passed via extra_requires field, it will run into error since the extra in this case is blindly added in the following line in py_wheel.bzl

metadata_contents.append(
    "Requires-Dist: %s; extra == '%s'" % (requirement, option),
)

Thus, this PR adds a post-process for this case, to make it possible to pass something like

    extra_requires = {"example": [
        "pyyaml>=6.0.0,!=6.0.1",
        'toml; (python_version == "3.11" or python_version == "3.12") and python_version != "3.8"',
        'wheel; python_version == "3.11" or python_version == "3.12" ',
    ]},

to py_wheel

Copy link
Collaborator

@aignas aignas left a comment

Choose a reason for hiding this comment

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

Thanks!

@aignas aignas added this pull request to the merge queue Sep 7, 2024
Merged via the queue into bazel-contrib:main with commit a18ae49 Sep 7, 2024
4 checks passed
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.

2 participants