pip install from local directory doesnt add [build-system] dependencies

228 views Asked by At

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)

0

There are 0 answers