abundant-tent-27407
11/06/2025, 9:01 AMpython_distribution that I wasn't having prior. I'm getting the following error:
stderr:
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help
error: option --python-tag not recognized
Simplified taget:
python_distribution(
...
wheel_config_settings = {
"--global-option": [
"--python-tag",
"py311",
],
},
)
Any suggestions on what is going on here?wide-midnight-78598
11/06/2025, 1:15 PMbrief-scientist-13682
11/06/2025, 5:25 PM--python-tag is an option to the bdist_wheel subcommand and not a global setup.py option.
Old school:
:; touch foo.py
:; pex setuptools -- -c 'from setuptools import setup; setup(name="foo", version="0.1.0")' bdist_wheel --python-tag bar &>/dev/null
:; ls -1 dist/
foo-0.1.0-bar-none-any.whl
~New school:
:; echo 'from setuptools import setup; setup(name="foo", version="0.1.0")' > setup.py
:; pex build -c pyproject-build -- --config-setting=--build-option=--python-tag=baz . &>/dev/null
:; ls -1 dist/
foo-0.1.0-bar-none-any.whl
foo-0.1.0-baz-none-any.whl
foo-0.1.0.tar.gz
Always should have been bad:
:; pex build -c pyproject-build -- --config-setting=--global-option=--python-tag=baz .
* Creating isolated environment: venv+pip...
* Installing packages in isolated environment:
- setuptools >= 40.8.0
* Getting build dependencies for sdist...
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help
error: option --python-tag not recognized
ERROR Backend subprocess exited when trying to invoke get_requires_for_build_sdistbrief-scientist-13682
11/06/2025, 5:46 PM--build-option (and --global-option for that matter) besides reading the setuptools/build_meta.py source or casting your fortunes to stack overflow, AI slop, etc: https://peps.python.org/pep-0517/#config-settings
The fact that setuptools uses keys named like command line flags (with leading --, etc) in the config settings dict is hugely confusing of course.brief-scientist-13682
11/06/2025, 6:00 PM--global-option for this used to be supported but was deprecated here: https://setuptools.pypa.io/en/stable/history.html#v64-0-0
And killed here: https://setuptools.pypa.io/en/stable/history.html#v69-0-0
So it was this PR that killed you: https://github.com/pantsbuild/pants/pull/21314brief-scientist-13682
11/06/2025, 6:03 PMabundant-tent-27407
11/06/2025, 6:04 PMabundant-tent-27407
11/06/2025, 6:04 PM