python-poetry / python-poetry/poetry

`poetry add` should not install dependencies from groups previously excluded using `--without`

Open
#8,891 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

kind/feature status/triage
Dominant language
Python
Stars
34.3k
Forks
2.5k
Avg merge
2d 19h
Merged PRs (30d)
30

Description

  • Poetry version: 1.7.1
  • Python version: 3.11
  • OS version and name: Windows 11
  • [ x] I am on the latest stable Poetry version, installed using a recommended method.
  • [x ] I have searched the issues of this repo and believe that this is not a duplicate.
  • [x ] I have consulted the FAQ and blog for any relevant entries or release notes.

Issue

I previously excluded a group from poetry install, e.g.

poetry install --without my-optional-group

I then add a package to the main group with:

poetry add new-package

This installs all of the dependencies in my-optional-group before it installs new-package. Is this a bug or expected behaviour? How do I add just new-package still excluding all of the dependencies in my-optional-group that I don't want?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the sequence with poetry install --without my-optional-group followed by poetry add new-package on Poetry 1.7.1 and Python 3.11. Trace the install and add command entry points and their tests; done means adding the package does not install dependencies from the previously excluded group.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.