-
-
Notifications
You must be signed in to change notification settings - Fork 16
Description
TL;DR: Poetry does not provide (yet) any way to install a local package (cloned from github) in editable mode (the equivalent of pip install -e .
), and pip
does not support (yet) editable mode with pyproject.toml
. The solution is, for the time being, to provide a setup.py
.
Long version:
So here's my use-case: I'm using nbtlib as a dependency in my projects, which themselves might or might not use Poetry. For developing those projects, I can simply run pip3 install --user nbtlib
and done, a stable nbtlib
is downloaded from PyPI and installed in my ~/.local/lib/python3.x/site-packages
and made globally available to any project that might use it. (or install it in each project's virtualenv, same result)
But... I'd also like to contribute to nbtlib. So I clone it's github repo, install Poetry and pytest to run tests before creating PRs. So far so great. Now I want to use this modified version in my projects, so I need to install the local version (not a stable from PyPI). And it must be in editable mode, so any further changes are automatically refletected in my projects.
Poetry? No such feature. It's meant for managing a package's dependencies, not to install or use a package as a dependency. Pip? No luck: it does not support pip install -e .
with a pyproject.toml
:
01:15:27 rodrigo@desktop ~/work/minecraft/nbtlib master $ pip3 install --user -e .
ERROR: File "setup.py" not found. Directory cannot be installed in editable mode: /home/rodrigo/work/minecraft/nbtlib
(A "pyproject.toml" file was found, but editable mode currently requires a setup.py based build.)
Poetry is still too immature and lacks a lot of features to cover all use cases of setup.py
, pip
and etc. And pip
is not modern enough to use pyproject.toml
for all of its features.
If there's no better solution, I believe nbtlib should provide a setup.py
, at least until both tools mature.