python-poetry / python-poetry/poetry

Support extras to override a dependency

Open
#5,626 0 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

  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have searched the documentation and believe that my question is not covered.

Feature Request

I have a project that depends on a public pypi pacakge - however, for some installs, I would like them to be able to override the package themselves as an extra without having to override the dependency in their setup

Current functionality
[tool.poetry]
name = "my-awesome-package"

[tool.poetry.dependencies]
dependency = "^1.0"

User runs

pip install my-awesome-package git+https://github.com/forked/dependency

And deals with any version conflicts since it could be out of sync.

Desired functionality
[tool.poetry]
name = "my-awesome-package"

[tool.poetry.dependencies]
dependency = [ {version = "^1.0"}, { git = "https://github.com/forked/dependency", optional=true }

[tool.poetry.extras]
custom = ["dependency"]

User runs

pip install my-awesome-package[custom]

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

No files, tests, or entry points are named in the issue. Begin by tracing Poetry's dependency and extras handling, then define how an optional alternate source would be represented and validated; done means installing [custom] selects the override without changing the default dependency.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.