-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Closed
Labels
kind/featureFeature requests/implementationsFeature requests/implementations
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.
Question
How can I specify differing sets of dependency extras for each of my project's extras? This is something that is relatively trivial to do with setup.py. To clarify, I would like to be able to specify the following dependency graph:
myproject[feature-a] depends on [dependency-one, dependency-two[feature-a]]
myproject[feature-b] depends on [dependency-one, dependency-two[feature-b]]
I'll propose a couple ways that pyproject.toml might model these graphs, but the core value of these examples is to highlight an apparent deficiency with the current model.
- By allowing dependency aliases that specify distinct sets of extras. For example:
[tool.poetry.dependencies]
…
dependency-two-a = { git = "git+ssh://[email protected]/projects/dependency-two.git",optional = true,extras = ["feature-a"], provides="dependency-two" }
dependency-two-b = { git = "git+ssh://[email protected]/projects/dependency-two.git",optional = true,extras = ["feature-b"], provides="dependency-two" }
…
[tool.poetry.extras]
feature-a = ["dependency-one", "dependency-two-a"]
feature-b = ["dependency-one", "dependency-two-b"]
- By treating the set of extras in the dependencies section as a superset that can be further filtered down when the dependency is referenced in the extras section. For example:
[tool.poetry.dependencies]
…
dependency-two = { git = "git+ssh://[email protected]/projects/dependency-two.git",optional = true,extras = ["feature-a", "feature-b"]}
…
[tool.poetry.extras]
feature-a = ["dependency-one", "dependency-two[feature-a]"]
feature-b = ["dependency-one", "dependency-two[feature-b]"]
Thanks for your time!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
kind/featureFeature requests/implementationsFeature requests/implementations