Skip to content

How tell pixi to use different pypi-options for different environments? #1949

Answered by asmith26
asmith26 asked this question in Q&A
Discussion options

You must be logged in to vote

Many thanks for your help and info @tdejager. Can confirm this works for me:

# pyproject.toml  -  pypi

[project]
name = "my_project"
requires-python = ">=3.12"

[tool.pixi.project]
channels = ["conda-forge"]
platforms = ["linux-64"]

[tool.pixi.dependencies]
python = ">=3.12"

[tool.pixi.feature.cpu]
pypi-options = { extra-index-urls = ["https://download.pytorch.org/whl/cpu"] }
pypi-dependencies = { "torch" = "*", "torchvision" = "*"}

[tool.pixi.feature.gpu]
system-requirements = {cuda = "12.2"}
pypi-options = { extra-index-urls = ["https://download.pytorch.org/whl/cu124"] }
pypi-dependencies = { "torch" = "*", "torchvision" = "*"}

[tool.pixi.environments]
cpu = ["cpu"]
gpu = ["gpu"]

a…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@asmith26
Comment options

Answer selected by asmith26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants