Skip to content

Poetry uninstalls all dependencies when removing any dependency via poetry remove #4632

@provinzkraut

Description

@provinzkraut
  • 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

When removing a dependency via poetry remove, poetry will uninstall every dependency in the pyproject.toml. It will however not remove them from pyproject.toml. This behavior exists for packages without any interdependence whatsoever.

Output of running poetry remove tqdm -vvv on the provided pyproject.toml:

Loading configuration file ~/.config/pypoetry/config.toml
Using virtualenv: ~/.cache/pypoetry/virtualenvs/poetry-test-y2U66Zct-py3.10
Updating dependencies
Resolving dependencies...
   1: fact: poetry-test is 0.1.0
   1: derived: poetry-test
   1: selecting poetry-test (0.1.0)
   1: Version solving took 0.003 seconds.
   1: Tried 1 solutions.

Writing lock file

Finding the necessary packages for the current system

Package operations: 0 installs, 0 updates, 2 removals

  • Removing dnspython (2.1.0): Pending...
  • Removing dnspython (2.1.0): Removing...
  • Removing dnspython (2.1.0)
  • Removing tqdm (4.62.3): Pending...
  • Removing tqdm (4.62.3): Removing...
  • Removing tqdm (4.62.3)

A subsequent poetry update will re-install all previously unnecessarily removed packages.

Metadata

Metadata

Assignees

Labels

kind/bugSomething isn't working as expected

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions