question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
jtrakkcommented, Aug 30, 2019

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. Then pip install -e works. So we could have a command build the setup.py and not remove it.

1reaction
albireoxcommented, Aug 30, 2019

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 time pyproject.toml changes). That way we could treat the generated setup.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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

PEP 660: Editable installs for PEP-517 style build backends
The way this is intended to be used is by asking frontends to install the project in editable mode, the wheels should be...
Read more >
How to install a package using pip in editable mode with ...
When a project is specified only via pyproject.toml (i.e. no setup.{py,cfg} files), how can it be installed in editable mode via pip ( ......
Read more >
pip install --editable . fails - Google Groups
Attempting to install via git, the first 2 commands work fine: ... However the next command errors out: C:\programming\leo-editor>pip install -- ...
Read more >
pyproject.toml - pip documentation v22.3.1
For performing editable installs, pip will use PEP 660 build_wheel_for_editable hook that has to be provided by the build backend. The wheels generated...
Read more >
30371 (Use pipenv to create venv for development) - Sage Trac
We modify src/setup.py to support editable installs via pipenv ( pipenv install -e . , which invokes pip install --editable ). Since distribution...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found