Skip to content

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

Closed

Description

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

>>> 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.

Activity

  1. jleclanche commented on Aug 15, 2021

    @jleclanche
    Contributor

    Confirming this behaviour on 1.2.0a2.

  2. finswimmer commented on Dec 24, 2021

    @finswimmer
    Member

    This is duplicated by #4632 and fixed by python-poetry/poetry-core#220.

  3. github-actions commented on Mar 2, 2024

    @github-actions

    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.

  4. locked as resolved and limited conversation to collaborators on Mar 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    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