Skip to content

Package extras are not removed when install command is given --sync option #7364

@zyzzyxdonta

Description

@zyzzyxdonta
  • I am on the latest stable Poetry version, installed using a recommended method.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have consulted the FAQ and blog for any relevant entries or release notes.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option) and have included the output below.

Issue

When poetry install is executed with the --sync option, currently installed extras are not removed:

[david:/tmp/tmp.eORMnPgjG6] $ poetry install
Creating virtualenv test-qNG81csJ-py3.11 in /home/david/.cache/pypoetry/virtualenvs
Updating dependencies
Resolving dependencies... (0.2s)

Writing lock file

Package operations: 5 installs, 0 updates, 0 removals

  • Installing certifi (2022.12.7)
  • Installing charset-normalizer (3.0.1)
  • Installing idna (3.4)
  • Installing urllib3 (1.26.14)
  • Installing requests (2.28.2)
[david:/tmp/tmp.eORMnPgjG6] 4s $ poetry install --extras toml
Installing dependencies from lock file

Package operations: 1 install, 0 updates, 0 removals

  • Installing tomli (2.0.1)
[david:/tmp/tmp.eORMnPgjG6] $ poetry install --sync
Installing dependencies from lock file

No dependencies to install or update
[david:/tmp/tmp.eORMnPgjG6] $ poetry install
Installing dependencies from lock file

Package operations: 0 installs, 0 updates, 1 removal

  • Removing tomli (2.0.1)

I believe that this is not in line with the documentation which states:

Any extras not selected for install are always removed, regardless of --sync.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working as expectedstatus/triageThis issue needs to be triaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions