cool-easter-32542
11/29/2023, 7:04 PM--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
pantsbuild/pants