Poetry: Why does `poetry install --develop` require an argument?

Created on 18 Oct 2018  ·  14Comments  ·  Source: python-poetry/poetry

  • [x] I have searched the issues of this repo and believe that this is not a duplicate.
  • [x] I have searched the documentation and believe that my question is not covered.

Question


With the deprecation of poetry develop and the switch to poetry install --develop I'm curious why --develop requires an argument (e.g., --develop foo)? After a quick glance at the command source it doesn't appear to be used for anything.

CLI

Most helpful comment

There was a behavioral change in version 0.12.0 which makes path dependencies always installed in editable mode.

So, at this time the --develop option is not longer necessary and thus should be removed.

For information, if you don't want the dependency to be installed in editable mode you can specify it in the pyproject.toml file.

[tool.poetry.dependencies]
my-package = {path = "../my/path", develop = false}

All 14 comments

I believe that if you specify one of your dependencies via a path (a local dependency) and want it to be installed in editable mode, you have to do poetry install --develop that_local_dependency.

@cauebs - not sure that's true, I tried poetry install --develop ../some_git_checkout and it didn't do what I was expecting. Looks like it's just re-installed from the .lock file in the current directory, rather than installing the package at ../some_git_checkout into my current poetry project.

I had some struggle with this too. I really expected poetry install --develop . to work – it says successful, but the package is not installed.
After some trial and error, I found that I should do poetry install --develop <name-of-my-package> instead.
A little bit not intuitive.

@dmfigol - how does poetry install --develop <name-of-package> related to poetry add --path=. <name-of-package>?

I am not sure I understand your question, since this is a thread about poetry develop and poetry install --develop.
I expected poetry install --develop to work as pip install -e ., i.e. installing a package in the editable mode.

Yes, but my read of the docs is that poetry add --path=. is closer to pip install -e ., which is why I asked...

I had some struggle with this too. I really expected poetry install --develop .

That's interesting because poetry install --develop . always installs the project for me. As I said in my original comment, it doesn't appear that the argument to --develop is used for anything.

Also, I just tested with the latest release (0.12.5) and now just plain old poetry install seems to install the project itself. I haven't looked at the underlying code changes so I have no idea if it's on purpose or not. All the churn over the last few weeks has been a little frustrating.

@jaswilli I remember note in some latest changelog about install using --develop by default. I have to admit, I am a bit confused too.

@vlcinsky Interesting. After looking briefly at the install command that appears to be the current state of things, i.e., that poetry install will install the current project so you don't need to use the --develop flag at all. That's perfect for my use case.

That said, I can't seem to get --develop <some other local package location> to do anything so that may still be a relevant issue.

Progress!

@jaswilli - I have a feeling that develop <some other local package location> from pip is more likely to be spelled add --path <some other local package location> in poetry, but I'd have to defer to @sdispater for a definite answer...

I'm going to close this as my original question has been addressed with the behavior change (i.e., --develop is no longer needed to install the local package).

@jaswilli I think, that you shall reopen the issue. The problem seems to be, that poetry install --develop option is useless or has undefined or at least not understood purpose.

To resolve this issue, I would expect following steps:

  • clarify purpose of the --develop option
  • evaluate, if it is needed
  • remove it, if it is obsolete or improve documentation/CLI instructions to make the usage clear.

According to my current understanding the --develop is obsolete and shall be removed. If @sdispater agrees, we shall remove it from poetry.

There was a behavioral change in version 0.12.0 which makes path dependencies always installed in editable mode.

So, at this time the --develop option is not longer necessary and thus should be removed.

For information, if you don't want the dependency to be installed in editable mode you can specify it in the pyproject.toml file.

[tool.poetry.dependencies]
my-package = {path = "../my/path", develop = false}

@jaswilli keep this issue closed, I have created #647 issue to track the removal of obsolete --develop option.

Was this page helpful?
0 / 5 - 0 ratings