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

How to specify the same package with different extras for different extras #7738

Closed
1 task done
danielgafni opened this issue Mar 29, 2023 · 2 comments
Closed
1 task done
Labels
area/docs Documentation issues/improvements status/triage This issue needs to be triaged

Comments

@danielgafni
Copy link

danielgafni commented Mar 29, 2023

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

Issue

I'm trying to achieve something like:

my-package = { extras = ["cpu", "gpu"], version = "^0.1.0", optional = true, source = "my-source"}

[tool.poetry.extras]
cpu = [
    "my-package[cpu]",
]
gpu = [
    "my-package[gpu]"
]

To clarify, this is not my-package's pyproject.toml, but another package's (let's call it my-downstream-package) pyproject.toml.

Obviously, this config doesn't work. I'm just trying to illustrate what I want to achieve.

I wonder if it's possible to do with Poetry at all?

Perhaps something like an alias can solve this?

my-package-cpu = { extras = ["cpu"], version = "^0.1.0", optional = true, source = "my-source", name = "my-package" }
my-package-gpu = { extras = ["gpu"], version = "^0.1.0", optional = true, source = "my-source", name = "my-package" }

[tool.poetry.extras]
cpu = [
    "my-package-cpu",
]
gpu = [
    "my-package-gpu"
]
@danielgafni danielgafni added area/docs Documentation issues/improvements status/triage This issue needs to be triaged labels Mar 29, 2023
@dimbleby
Copy link
Contributor

dimbleby commented Mar 29, 2023

duplicate #834, #3913, #5733, #6053, ...

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/docs Documentation issues/improvements status/triage This issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

2 participants