Skip to content
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

wheel_config_settings, --global-option --python-tag breaks with setuptools >= 69.0 #20247

Open
bradday4 opened this issue Nov 29, 2023 · 2 comments

Comments

@bradday4
Copy link

Describe the bug
Passing --python-tag as part of --global-option in the wheel_config_settings dictionary of a python_distribution target results in the following error if using setuptools version >= 69:

stderr:
usage: backend_shim.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: backend_shim.py --help [cmd1 cmd2 ...]
   or: backend_shim.py --help-commands
   or: backend_shim.py cmd --help

error: option --python-tag not recognized

Here's a minimal reproduction of an example python_distribution target for pants

python_distribution(
    name="mydist",  # this is the name given to the target
    provides=python_artifact(name="mylib")
    wheel_config_settings={"--global-option": ["--python-tag", "py38.py39.py310"]},
    generate_setup=False,
)

Along with the relevant portion of my pyproject.toml

[build-system]
requires = ["setuptools ~= 69.0", "wheel"]
build-backend = "setuptools.build_meta"

The documentation for pants shows the --global-option parameter being used but should be updated to to note the breaking change with setuptools.
Substitututing --global-option with --build-option fixes the issue and appears to work with earlier versions of setuptools back to 64.0

Pants version
Which version of Pants are you using?
2.18
OS
Linux

Additional info
Here is the PR for the change in setuptools
And the discussion that precipitated it

@bradday4 bradday4 added the bug label Nov 29, 2023
@benjyw
Copy link
Sponsor Contributor

benjyw commented Dec 1, 2023

If I understand correctly, this not a bug in Pants but an issue with the documentation not being compatible with newer setuptools?

@benjyw
Copy link
Sponsor Contributor

benjyw commented Dec 1, 2023

The docs are in the repo now, feel free to send a PR with an appropriate update!

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

No branches or pull requests

3 participants