Closed gotmax23 closed 1 month ago
Hi @gotmax23 , setuptools.build_meta
was intentionally changed to not pass --build-option
to the metadata methods.
This was a decision taken to improve compatibility with pip
, see information in the thread starting in https://github.com/pypa/setuptools/issues/2491#issuecomment-1741870404 (key comment: https://github.com/pypa/setuptools/issues/2491#issuecomment-1743723820) for context. I don't think we are going to revert this.
Please also notice that passing parameters via --global-option
and --build-option
is provided as it is: an experimental attempt to emulate pip's old behaviour, but it is not guaranteed to do exactly what you want (specially because pip's old behaviour is not 100% equivalent/compatible with the build process initially introduced in PEP 517/660).
If you want to pass parameters to commands, the only guaranteed way that works right now is to use configuration files like setup.cfg
. See https://setuptools.pypa.io/en/latest/deprecated/distutils/configfile.html for reference.
I will go ahead and close this issue now, since this is not a planed feature in setuptools
.
If the solution mentioned in https://github.com/pypa/setuptools/issues/4293#issuecomment-2041579801 does not suit the use case, please consider contributing towards https://github.com/pypa/setuptools/discussions/4083.
setuptools version
setuptools==69.2.0 and wheel==0.43.0
Python version
Python 3.12
OS
Fedora Linux
Additional environment information
No response
Description
I am trying to run the
prepare_metadata_for_build_wheel
hook for the https://github.com/Rogdham/pyzstd project as part of the Fedora Linux build process. The project requires passing--dynamic-link-zstd
when building without the in-treezstd
copy or else it fails withFileNotFoundError: [Errno 2] No such file or directory: 'zstd/lib/common/'
.I ran
and expected the build backend to pass
--dynamic-link-zstd
through to the internalsetup.py dist_info
subcommand that it calls to generate the metadata. Instead, it only passes['dist_info', '--output-dir', 'dist', '--keep-egg-info']
.Should pyzstd be changed to allow setting this option through a different mechanism (e.g., an environment variable) or can setuptools start honoring
--build-option
for theprepare_metadata_for_build_wheel
hook?Relates: https://github.com/pypa/setuptools/issues/3896
CC: @Rogdham
Expected behavior
See above
How to Reproduce
Checkout https://github.com/Rogdham/pyzstd without the
zstd
submodule and run the command mentioned above.Output
n/a