python-poetry / python-poetry/poetry
Packages included in an Extra
Nobody has claimed this yet.
- 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 (
-vvvoption) 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>, thenpackagedoesn't install. (It should!) - If I publish the project and then do
pip install my_project, thenpackagedoesn't install. (It should!)- But if I do
pip install my_project[extra]thenpackagedoes install.
- But if I do
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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