PEP-517 and pip install --editable with pip 19
See original GitHub issue- I have searched the issues of this repo and believe that this is not a duplicate.
- I have searched the documentation and believe that my question is not covered.
Question
Hi,
Apologies if this has been answered before but I’ve looked at a number of issues and discussions about this and I’m still confused about the details.
As of pip 19.2.1 it is not possible anymore to do pip install -e .
on a poetry-managed project with a pyproject.toml
regardless of whether the build-system
is defined. As I understand it, this was done so on purpose.
Is there a working workaround around this issue? In my organisation we work with multiple projects that are not in PyPI and that are not even intended to be installed to site-packages. We do python setup.py build
and then add the resulting build directory to PYTHONPATH. It may be argued this is not good practice but …
I’ve been really liking poetry but this is kind of a dealbreaker for me. I can convince people in my project to do pip install -e .
instead of python setup.py build
(and yet I’ll get complaints) but anything beyond that, such as forcing people to use poetry for building the project, is not really workable.
Alternatively, is there a way to generate a setup.py
from the pyproject.toml
? I assume there is since the distribution source file contains one. If so, maybe it could be added to poetry install
as an option that generates the setup.py
, the same way the poetry.lock
file is generated. It’s not a good solution but it would solve the problem for now.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:12 (6 by maintainers)
Top GitHub Comments
Ok I just tried this. Poetry already creates and deletes a setup.py during
poetry install
. If I comment out the part where it deletes the setup.py afterwards, I get a setup.py in the directory. Thenpip install -e
works. So we could have a command build the setup.py and not remove it.I think that’s correct. But ultimately pip fails because there isn’t a setup.py file. If there were, I think it would run that and ignore the
pyproject.toml
file. So a workaround could be to introduce a poetry command to generate the setup.py file (or even better, update it every timepyproject.toml
changes). That way we could treat the generatedsetup.py
the same way we do with the lockfile and commit it. People without poetry would still be able to use pip to install the package.