I am often working on multiple python packages with interdependencies defined in pyproject.toml. I want them all installed in editable mode, which seems harder than it should be. What I want to do is to:
- Clone each package locally using git
- Install each package in editable mode with
pip install -e .
Notionally, I’d do this in logical order for dependency.
Let us say I have two packages, parent
and child
, where child
lists parent
as a dependency in pyproject.toml. If I install parent
then child
in editable mode then when installing child
, pip
will try to download and re-install parent
from the repository. This can cause confusion if not realized, since you might not realize you’ve accidently installed a non-editable version of parent
into your environment.
Is there any way to tell pip
to respect the version of the package you already have installed in editable mode? I would like a way to do this in pyproject.toml, or by providing some flag to pip.
Options Already Considered
I know I could use pip --no-deps
with child
, but that causes it to not install any dependencies. Sometimes child
has dependencies that you’ll want installed in addition to parent
.
I could also always install in reverse order (child
then parent
), which isn’t a bad solution. But this can get complicated if you are working on multiple “children”, or have more complex dependency trees.