python-poetry / poetry

Python packaging and dependency management made easy
https://python-poetry.org
MIT License
31.69k stars 2.27k forks source link

[1.2.0a2] Running poetry remove uninstalls all default dependencies. #4373

Closed onerandomusername closed 2 years ago

onerandomusername commented 3 years ago

Issue

>>> poetry add python-dotenv
Using version ^0.19.0 for python-dotenv

Updating dependencies
Resolving dependencies... (31.9s)

Writing lock file

Package operations: 0 installs, 1 update, 0 removals

  • Updating discord.py (2.0.0a3453+g58ca9e99 58ca9e9 -> 2.0.0a3466+g6e6c8a7b 6e6c8a7)
>>> poetry remove python-dotenv
Updating dependencies
Resolving dependencies... (2.2s)

Writing lock file

Package operations: 0 installs, 0 updates, 20 removals

  • Removing aiodns (3.0.0)
  • Removing aiohttp (3.7.4.post0)
  • Removing arrow (1.1.1)
  • Removing async-timeout (3.0.1)
  • Removing brotlipy (0.7.0)
  • Removing cchardet (2.1.7)
  • Removing cffi (1.14.6)
  • Removing chardet (4.0.0)
  • Removing coloredlogs (15.0.1)
  • Removing discord.py (2.0.0a3466+g6e6c8a7b 6e6c8a7)
  • Removing environs (9.3.3)
  • Removing humanfriendly (9.2)
  • Removing marshmallow (3.13.0)
  • Removing multidict (5.1.0)
  • Removing pycares (4.0.0)
  • Removing pycparser (2.20)
  • Removing pydantic (1.8.2)
  • Removing python-dateutil (2.8.2)
  • Removing python-dotenv (0.19.0)
  • Removing yarl (1.6.3)

This is just after running poetry run task export, which expanded, is the following:

echo 'Exporting installed packages to requirements.txt.\n\
This task automatically relocks the lock file using "poetry lock --no-update"' && \
poetry lock --no-update && \
echo '# Do not manually edit.\n# Generate with "poetry run task export"\n' > requirements.txt && \
echo "Exporting..." && \
poetry export --without-hashes >> requirements.txt && \
echo "Done exporting."

Please note, this is in the toml file and is a multiline string, which needed to be escaped.

Desired Behavior

Poetry should not uninstall all default dependencies when removing one dependency from a project.

jleclanche commented 3 years ago

Confirming this behaviour on 1.2.0a2.

finswimmer commented 2 years ago

This is duplicated by #4632 and fixed by https://github.com/python-poetry/poetry-core/pull/220.

github-actions[bot] commented 8 months ago

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.