-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Description
-
I am on the latest Poetry version.
-
I have searched the issues of this repo and believe that this is not a duplicate.
Well... This issue is mentioned by @sontek in Poetry install removes packages that are necessary #3139 (comment)_ but the response below advises to create a new issue, so here I am. -
If an exception occurs when executing a command, I executed it again in debug mode (
-vvvoption). -
OS version and name: Docker image based on
python:3.9.1 -
Poetry version: 1.1.6
-
Link of a Gist with the contents of your pyproject.toml file: https://gist.github.com/gbdlin/311dda3cd34672370cd97bf07f306a61
Issue
When you specify a package in the dev-dependencies that is either a dependency of the poetry itself or it depends on one of the poetry dependencies, and you've installed poetry inside an environment that poetry is supposed to manage, poetry will uninstall this mentioned dependency after invoking poetry install --no-dev, making itself unusable in the future.
I'm aware that it is advised to install poetry outside of the environment it should manage, but this is very often seen inside docker images (such example provided in the gist linked above) to save on the resources.
Example output presenting mentioned issue (without -vvv ands):
$ pip install poetry
Requirement already satisfied: pip in /usr/local/lib/python3.9/site-packages (21.0.1)
Collecting poetry
Downloading poetry-1.1.6-py2.py3-none-any.whl (172 kB)
[ ... 70 irrelevant output lines truncated ... ]
Collecting appdirs<2,>=1.4.3
Downloading appdirs-1.4.4-py2.py3-none-any.whl (9.6 kB)
Installing collected packages: [ ... ] appdirs, [ ... ] poetry
Successfully installed [ ... ] appdirs-1.4.4 [ ... ] poetry-1.1.6 [ ... ]
$ poetry config virtualenvs.create false && poetry install --no-dev
Skipping virtualenv creation, as specified in config file.
Installing dependencies from lock file
Package operations: 0 installs, 0 updates, 1 removal
• Removing appdirs (1.4.4)
Removing intermediate container af920367a74d
As you can see, appdirs, which is required by the poetry, was uninstalled by poetry. Full log, with the -vvv and the attempt to run poetry again, available here