-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Labels
Description
setuptools version
setuptools==80.9
Python version
Python 3.12 (should not matter)
OS
n/a
Additional environment information
No response
Description
When passing an empty install_requires=[] argument to setup(), the generated PKG-INFO does not contain the line
Dynamic: requires-dist
even though project.dynamic = ["dependencies"] is set in pyproject.toml.
Why this edge case?
The cudaq project publishes multiple packages wheels for multiple supported versions of CUDA. We then have a metapackage that is sdist only that finds the installed CUDA version on the user's system at install time and sets its dependency dynamically accordingly.
To achieve this, the sdist package initially declares an empty dependency list.
Expected behavior
The file PKG-INFO generated by python -m build should contain a line
Dynamic: requires-dist
How to Reproduce
- create an empty package with
project.dynamic = ["dependencies"]set inpyproject.toml - set the build backend to
setuptools.build_metaand create asetup.pyfile withsetup(install_requires=[]) - run
python -m build cd dist && tar xvf package-name-version.tar.gz && cat package-name-version/PKG-INFO | grep Dynamic
Output
The fourth step outputs nothing. It should output Dynamic: requires-dist