-
-
Notifications
You must be signed in to change notification settings - Fork 227
Closed
Labels
Description
According to #873, version guessing is supposed to be opt-in, but I'm getting version-related error even though I'm not opting in (AFAIK).
I would like to use setuptools-scm for selecting files, but not for guessing the version.
Since recently, I'm getting an error in CI (e.g. https://github.com/mgeier-forks/insipid-sphinx-theme/actions/runs/18633111193/job/53120584975):
UserWarning: pyproject.toml: at [tool.setuptools.dynamic]
version = {attr = ...} is forcing setuptools to override the version setuptools-scm did already set
When using setuptools-scm it's invalid to use setuptools dynamic version as well, please remove it.
Setuptools-scm is responsible for setting the version, forcing setuptools to override creates errors.
Full error:
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'error'
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [57 lines of output]
toml section missing PosixPath('pyproject.toml') does not contain a tool.setuptools_scm section
Traceback (most recent call last):
File "/opt/hostedtoolcache/Python/3.13.8/x64/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 389, in <module>
main()
~~~~^^
File "/opt/hostedtoolcache/Python/3.13.8/x64/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 373, in main
json_out["return_val"] = hook(**hook_input["kwargs"])
~~~~^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.13.8/x64/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 143, in get_requires_for_build_wheel
return hook(config_settings)
File "/tmp/pip-build-env-6b588fc3/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 331, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=[])
~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/pip-build-env-6b588fc3/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 301, in _get_build_requires
self.run_setup()
~~~~~~~~~~~~~~^^
File "/tmp/pip-build-env-6b588fc3/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 317, in run_setup
exec(code, locals())
~~~~^^^^^^^^^^^^^^^^
File "<string>", line 1, in <module>
File "/tmp/pip-build-env-6b588fc3/overlay/lib/python3.13/site-packages/setuptools/__init__.py", line 115, in setup
return distutils.core.setup(**attrs)
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
File "/tmp/pip-build-env-6b588fc3/overlay/lib/python3.13/site-packages/setuptools/_distutils/core.py", line 148, in setup
_setup_distribution = dist = klass(attrs)
~~~~~^^^^^^^
File "/tmp/pip-build-env-6b588fc3/overlay/lib/python3.13/site-packages/setuptools/dist.py", line 321, in __init__
_Distribution.__init__(self, dist_attrs)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
File "/tmp/pip-build-env-6b588fc3/overlay/lib/python3.13/site-packages/setuptools/_distutils/dist.py", line 309, in __init__
self.finalize_options()
~~~~~~~~~~~~~~~~~~~~~^^
File "/tmp/pip-build-env-6b588fc3/overlay/lib/python3.13/site-packages/setuptools/dist.py", line 784, in finalize_options
ep(self)
~~^^^^^^
File "/tmp/pip-build-env-6b588fc3/overlay/lib/python3.13/site-packages/setuptools_scm/_integration/setuptools.py", line 145, in infer_version
pyproject_data = read_pyproject(_given_result=_given_pyproject_data)
File "/tmp/pip-build-env-6b588fc3/overlay/lib/python3.13/site-packages/setuptools_scm/_integration/pyproject_reading.py", line 243, in read_pyproject
warn_pyproject_setuptools_dynamic_version(path)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
File "/tmp/pip-build-env-6b588fc3/overlay/lib/python3.13/site-packages/setuptools_scm/_integration/deprecation.py", line 16, in warn_pyproject_setuptools_dynamic_version
warn_dynamic_version(path, "tool.setuptools.dynamic", "version = {attr = ...}")
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/pip-build-env-6b588fc3/overlay/lib/python3.13/site-packages/setuptools_scm/_integration/deprecation.py", line 7, in warn_dynamic_version
warnings.warn(
~~~~~~~~~~~~~^
f"{path}: at [{section}]\n"
^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<2 lines>...
"Setuptools-scm is responsible for setting the version, forcing setuptools to override creates errors."
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
UserWarning: pyproject.toml: at [tool.setuptools.dynamic]
version = {attr = ...} is forcing setuptools to override the version setuptools-scm did already set
When using setuptools-scm it's invalid to use setuptools dynamic version as well, please remove it.
Setuptools-scm is responsible for setting the version, forcing setuptools to override creates errors.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.
I'm using this in pyproject.toml:
[build-system]
requires = ["setuptools", "setuptools-scm"]
build-backend = "setuptools.build_meta"
...
[tool.setuptools.dynamic]
version = {attr = "insipid_sphinx_theme.__version__"}