Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Directory Dependency with develop=false still installing with pip -e #1073

Closed
3 tasks done
eblume opened this issue May 3, 2019 · 4 comments
Closed
3 tasks done

Directory Dependency with develop=false still installing with pip -e #1073

eblume opened this issue May 3, 2019 · 4 comments

Comments

@eblume
Copy link
Contributor

eblume commented May 3, 2019

  • I am on the latest Poetry version.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).

Issue

Hello! This is a weird one. Before I continue: I was able to resolve this issue by deleting the virtual environment and rebuilding it. Therefore, perhaps this is not worth looking any more in to. [edit: see comment below - issue has returned] I wanted to file this anyway since I spent a fair few hours in pdb tracing through the issue, and it might help someone else in the future to report it here. (To be clear, the fix for me was: rm -rf ~/.cache/pypoetry/ && poetry update - but take care that this will delete all of your poetry venvs. You can be more specific if you need to.)

On to the issue: I have two projects that I am developing, Project A and Project B. Both are Poetry projects. Project B depends on A, and so I added

project_a = {path = "../project_a/", develop=false}

I found that I needed to add develop=false because pip would not allow me to install a pyproject.toml-only project in development mode. There is a large discussion on this topic happening right now, you can read details here: https://discuss.python.org/t/pip-19-1-and-installing-in-editable-mode-with-pyproject-toml/1553

This is all fine and the documentation for poetry supports this. However, I found that when I went to install this change (poetry update), I got the same pip error, and indeed the error message showed a -e flag being given!

I traced and traced the application, and the best I could discover is that Solver._solve was returning a package object for Project A that did not include the develop flag. Specifically, this line, the following held true: https://github.com/sdispater/poetry/blob/f84988ab3c59e731b6481031721a1ee19a5acc10/poetry/puzzle/solver.py#L38

[p for p in packages if p.name == 'project_a'][0].develop == True  # False expected!

Tracing elsewhere in the program, it seemed like the installation command's environment's "package" variable correctly identified develop as False. So somewhere in the Locker, it seems, the develop flag was getting lost and being replaced by a default. I guess?

Ok, so that's all interesting, but here's where I gave up and came here to post:

I created an example project to file a bug report, which is the gist linked at the top of this report. IT WORKED. So I deleted my virtual environment, re-installed it, and it worked.

I am left scratching my head, unable to reproduce the issue any longer.

I hope this helps someone else and my time was not wasted. Good luck!

@eblume
Copy link
Contributor Author

eblume commented May 3, 2019

I take it back - this issue has returned. The reason the error went away was that I had previously (outside of poetry but within a poetry shell shell that had loaded the venv) ran pip install --upgrade pip to go from pip-10.0.1 to pip-19.1.

This does still seem to be an issue, then. I'll continue debugging tomorrow, but I may just roll back to pip-10.0.1 and put up with its constant nagging to upgrade.

@chrahunt
Copy link

chrahunt commented May 7, 2019

You do not need to roll back, pip 19.1.1 (released 2019/05/06) reverts to the previous behavior.

@eblume
Copy link
Contributor Author

eblume commented May 9, 2019

Perfect, thanks!

@eblume eblume closed this as completed May 9, 2019
Copy link

github-actions bot commented Mar 3, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants