Replies: 2 comments
-
He @anjos thanks for the write-up. The name mapping is something we fix with This was one of the first requests around the So adding it as an "opt-in" option sound like a logical next step! Currently the There was an effort for a design in : #1094 (comment) which is part of this story. That would result in something like: [pypi-options]
# When not used, will use uv default which is just pypi
primary-index = "pypi.org/simple"
extra-indices = ["foo", "bar"]
flat-indices = ["path/to/index"]
convert-to-conda = true
# Or
# convert-to-conda = { dep3 = "dependency3" }
# or a different name
# Or only per feature if you want that, as conda is safer.
[feature.prod.pypi-options]
convert-to-conda = true What I'm trying to say is, thanks for the write-up, this is most definitely coming, stay connected or contribute if you can 😃. |
Beta Was this translation helpful? Give feedback.
-
Right, looks like the right thing to do.
I may be overlooking something, however I think the mapping should be only one way: converting Thinking about it a bit deeper, you also may want to "exclude" packages from auto-conversion. This could be useful in cases where there are PyPI packages that simply do not exist as conda packages. Some examples borrowing from your nomenclature: [pypi-options]
# brute force convert all pypi-dependencies to dependencies (default is false)
convert-to-conda = true
# brute force convert all pypi-dependencies to dependencies, except dep3
convert-to-conda = {force-conda = true, mappings = {dep3 = "dependency3"}}
# converts only dep1 and dep3
convert-to-conda = {mappings = {dep1 = "dep1", dep3 = "dependency3"}}
# converts dep1 and dep2, not dep3 (leave it in pypi-dependencies)
convert-to-conda = {force-conda = true, except = ["dep3"]}
# or
convert-to-conda = ["dep1", "dep2"]
The per-feature add-on would be a plus IMO.
I'm not sure how to contribute as my rust skills are zero presently - please let me know how to be useful (e.g. I can open an issue with this suggestion, or contribute to an open issue if that is useful). |
Beta Was this translation helpful? Give feedback.
-
In the context of pixi manifests in
pyproject.toml
files, I wonder to what extent one can smartly map Python dependencies that are automatically injected fromproject.dependencies
aspypi-dependencies
, into condadependencies
.I'm raising this question because, In some cases, Python dependencies and conda dependencies have slightly different names (e.g.
torch
in PyPI vspytorch
in conda-forge). However, whenpixi install
ing the project, one may want to prefer conda dependencies and avoid altogether the installation of PyPI equivalents.As of now, one has to repeat conda dependencies in
pyproject.toml
manifests, what looks like this:If the project has many dependencies, the above process becomes tedious and error-prone. If one of the dependencies is forgotten on
tool.pixi.dependencies
, then it is automatically injected intotool.pixi.pypi-dependencies
, which may inadvertently trigger issues such as #1051 or #1046.I wonder if it would not be possible, instead to have something like:
A feature such as this would allow further control over the packaging-type of dependencies to be installed.
Possibly connected to #532 and #1198.
Beta Was this translation helpful? Give feedback.
All reactions