Is it possible to halve your cake and eat it too: can one install (via some mechanism) a project with the following structure:
pyproject.toml
setup.cfg
src/...
scripts/...
In editable mode, like one could with a standard setup.py
project:
python3 -m pip install -e .
(It is OK if the answer is: "one does not install pyproj.toml packages in editable mode")
Yes, pyproject. toml is the specified file format of PEP 518 which contains the build system requirements of Python projects. This solves the build-tool dependency chicken and egg problem, i.e. pip can read pyproject.
UPDATE: As of August 2022, Setuptools and Pip now fully support PEP 660, and therefore it is now possible to perform an editable installation with only pyproject.toml
.
NOTE: To be able to do an editable installation to your user site (pip install -e --user
), you need a system installed setuptools
v62.0.0 or newer.
After Pip version 21.1, you can use setup.cfg
for editable installs.
In the near future, you won't even need that, because there is finally a standard for editable installs that doesn't assume you're using Setuptools: PEP 660. When PEP-517-compatible build backends start also supporting PEP 660, then Pip editable installation will work on projects that only have a pyproject.toml
, i.e. PEP-517-only projects that don't support the legacy Setuptools interface (setup.py
/setup.cfg
).
Before Pip version 21.1 you needed a dummy setup.py
:
#!/usr/bin/env python
import setuptools
if __name__ == "__main__":
setuptools.setup()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With