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

Changing develop option is not reflected #3085

Closed
2 of 3 tasks
tamuhey opened this issue Oct 5, 2020 · 10 comments
Closed
2 of 3 tasks

Changing develop option is not reflected #3085

tamuhey opened this issue Oct 5, 2020 · 10 comments
Labels
area/solver Related to the dependency resolver kind/enhancement Not a bug or feature, but improves usability or performance

Comments

@tamuhey
Copy link
Contributor

tamuhey commented Oct 5, 2020

  • 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

TLDR; changing develop of a dependency field and poetry update don't have any effect.

I have a project consists of two poetry project:

. --  foo/
  |     |- pyproject.toml
  |-- bar/
        |- pyproject.toml

foo depends on bar as follows:

# pyproject.toml
...
[tool.poetry.dependencies]
python = "^3.8"
bar = {path="../bar"}
...

(Full example here: https://github.com/tamuhey/poetry111_bug_mvce/blob/master/foo/pyproject.toml)

Since the editable mode is false by default from poetry v1.1, bar is copied into another directory. It's ok.

But, after changing the dependency of bar to editable (develop = true) as follows and running poetry update don't change anything, as I expected that bar is changed to editable dependency.

# pyproject.toml
...
[tool.poetry.dependencies]
python = "^3.8"
bar = {path="../bar", develop=true}
...
@tamuhey tamuhey added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Oct 5, 2020
@ginty
Copy link

ginty commented Oct 5, 2020

I came here to say the same thing.

I expect that with develop=true a link will be created to the given path, such that when the files are updated they are automatically reflected in the parent app.

That works fine on 1.0.10 (without develop=true) but on 1.1.0 the dependency is copied into the virtualenv so that updates to the original source have no effect, even with develop=true.

@abn
Copy link
Member

abn commented Oct 5, 2020

@ginty that is what happens. The dependency is not copied, but installed as an editable dependency. However, since we do not use the egg-link hack, pip will not show it as a "develop" depenency.

@tadeoos am I correct in assuming that your scenario is an existing virtual environment created using 1.0.10? If so you will have to either re-add the dependency or re-create the virtualenvironment or do poetry run pip uninstall bar first. The previous installation would have used egg-links, when doing an update with develop=true nothing will change, since it is what it was defaulting to previously.

@tamuhey
Copy link
Contributor Author

tamuhey commented Oct 6, 2020

am I correct in assuming that your scenario is an existing virtual environment created using 1.0.10?

No. The venv is created by poetry v1.1.1

If so you will have to either re-add the dependency or re-create the virtualenvironment or do poetry run pip uninstall bar first.

Ok, I'll deal with it that way for now.

@tamuhey
Copy link
Contributor Author

tamuhey commented Oct 6, 2020

One question: Changing the default value for develop breaks backwards compatibility (e.g. in case of using symlink). Why this change is introduced in v1.1?

@ginty
Copy link

ginty commented Oct 6, 2020

Thanks for the quick reply @abn. I don't really understand what you mean, however, as this may be going off on a tangent from the original thread I've opened #3096 for further discussion on it.

@lochsh
Copy link

lochsh commented Dec 7, 2021

I am still seeing this issue on poetry 1.1.12. To be explicit:

  • pyproject.toml has dep = {path = "/path/to/dep"}
  • I run poetry update
  • /path/to/dep is copied into the venv, as expected
  • I edit pyproject.toml to have dep = {path = "/path/to/dep", develop=true}
  • I run poetry update
  • Instead of the dep in the venv being replaced by dep.pth file, it is not replaced and so I do not have an editable dependency.

Issues such as this and #3958 make it hard to feel confident that poetry update has done the right thing -- it's a shame to spend time cautiously deleting venvs just in case.

@kkuriata
Copy link

Yeah. I can confirm that it is really annoying. It's hard to develop anything when you have to poetry update after changes... And it takes much time to do that.

@smcoll
Copy link

smcoll commented Nov 7, 2022

Using 1.2.1 i was able to get an editable install working by updating to develop = true in the lockfile as well, then deleting the virtual environment (i'm using local .venv dir) before a poetry install. This method is creating a .pth file for each dependency in site-packages.

Of course, the issue description is still valid.

@neersighted neersighted added area/solver Related to the dependency resolver kind/enhancement Not a bug or feature, but improves usability or performance and removed kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Nov 8, 2022
@neersighted
Copy link
Member

Resolved in #6843.

Copy link

github-actions bot commented Mar 1, 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 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/solver Related to the dependency resolver kind/enhancement Not a bug or feature, but improves usability or performance
Projects
None yet
Development

No branches or pull requests

7 participants