python-poetry / python-poetry/poetry

Packages included in an Extra

Open
#8,322 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

  • Poetry version: Poetry (version 1.5.1)
  • Python version: Python: 3.10.10
  • OS version and name: macOS 13.5
  • pyproject.toml:
[tool.poetry.dependencies]
package =  {version = "^1.4.49", optional = false}

[tool.poetry.extras]
extra = ["package"]
  • 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

If I run poetry install, package installs as expected.

However,

  • If I add this project to another project poetry add <path_to_project>, then package doesn't install. (It should!)
  • If I publish the project and then do pip install my_project, then package doesn't install. (It should!)
    • But if I do pip install my_project[extra] then package does install.

Summary:

package =  {version = "^1.4.49", optional = false}

Should not have the same result as:

package =  {version = "^1.4.49", optional = true}

When it comes to installing a project externally. Just because it's included in one of the extras... especially when it installs as expected within a project.

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 with the provided pyproject.toml and reproduce the behavior using poetry install, poetry add <path_to_project>, pip install my_project, and pip install my_project[extra]. Done means a dependency marked optional = false is installed when included in an extra, including for external installation, without requiring the extra to be requested.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.