0

In our project (Locust) we use setuptools_scm for versioning, so it is needed for all installations from local directory.

We used to have this specified in setup.py:

setup(
    setup_requires=["setuptools_scm>=6.2"],
    ...
)

But we have upgraded to use setup.cfg and pyproject.toml

[build-system]
requires = ["setuptools_scm>=6.2", ...]

This works nicely in most cases, but it does not install setuptools_scm if someone does pip install -e . (it doesnt work for pip install . either but that is less important)

With no setuptools_scm installed the local version becomes 0.0.0:

~/git/locust pip install -e .
Looking in indexes: https://pypi.org/simple
...
  Running setup.py develop for locust
Successfully installed locust-0.0.0

... and that makes me very sad.

What is the appropriate way make pip install setuptools_scm when installing from source?

I could of course add it as a regular dependency in setup.cfg, but that would make thousands of users download setuptools_scm even when it is not needed (when installing from PyPi)

sinoroc
  • 18,409
  • 2
  • 39
  • 70
Cyberwiz
  • 11,027
  • 3
  • 20
  • 40
  • 1
    Not sure it is supported yet. PEP 660 support in setuptools is very, very new. Maybe ask in [this discussion here](https://discuss.python.org/t/help-testing-pep-660-support-in-setuptools/16904), or on the ticket trackers of [_`setuptools`_](https://github.com/pypa/setuptools/issues) or [_`setuptools_scm`_](https://github.com/pypa/setuptools_scm/issues). -- I wonder if [this ticket here](https://github.com/pypa/setuptools/issues/3501) might be related. – sinoroc Aug 16 '22 at 21:22
  • Some seem to say that it worked for their use case: https://discuss.python.org/t/help-testing-pep-660-support-in-setuptools/16904/19 and https://discuss.python.org/t/help-testing-pep-660-support-in-setuptools/16904/29 – sinoroc Aug 16 '22 at 21:34

0 Answers0