Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify distinct dependency extras for distinct poetry project extras! #3913

Open
2 tasks done
acturner opened this issue Apr 10, 2021 · 1 comment
Open
2 tasks done
Labels
kind/feature Feature requests/implementations status/triage This issue needs to be triaged

Comments

@acturner
Copy link

acturner commented Apr 10, 2021

  • 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

Currently, adding an optional dependency to have in extras only allows one dependency per project. The issue here is that I may have two extras for my projects, say distributed and server, with ray and ray[serve] as dependencies respectively.

When I poetry add ray we modify the dependencies as

[tool.poetry.dependencies]
python = "^3.8"
ray = {version = "^1.2.0", optional = true}

and then when I add ray[serve] on top it modifies the dependencies as

[tool.poetry.dependencies]
python = "^3.8"
ray = {extras = ["serve"], version = "^1.2.0", optional = true}

getting rid of the default ray. Thus, I don't see any way to have something like

[tool.poetry.extras]
distributed = ["ray"]
server = ["ray[serve]"]

without also installing ray[serve] as part of the distributed extra!

I cannot think of any reason this would be desired behavior to not allow treating dependency extras as separate. While I haven't spent a great deal of time thinking about a design for a proposed solution, the above seems reasonable to me (that when specified in extras, a reference to ray does not include ray[serve] by default).

@acturner acturner added kind/feature Feature requests/implementations status/triage This issue needs to be triaged labels Apr 10, 2021
@JuniorJPDJ
Copy link

Bump. Now I need to copy dependencies of package I depend on and add it to my extra. This is very easy to forget and far from ideal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Feature requests/implementations status/triage This issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

2 participants