pixi icon indicating copy to clipboard operation
pixi copied to clipboard

Resolving Python packages with extra can raise warnings when the extra dependency is a conda dependency

Open matthewfeickert opened this issue 4 weeks ago • 0 comments
trafficstars

Checks

  • [x] I have checked that this issue has not already been reported.

  • [x] I have confirmed this bug exists on the latest version of pixi, using pixi --version.

Reproducible example

(That is maybe not the most clear title ever, so please feel free to revise it to something more clear).

In https://github.com/iris-hep/integration-challenge/pull/7 we encountered a situaiton where upgrading an environment with a Python dependency that contains a dependency with extras had one of the extra dependencies defined already as a conda package. This raises a "does not have an extra named" warning, which is confusing, though correct.

Minimal reproducer

$ pixi self-update 
✔ pixi is already up-to-date (version 0.58.0)
$ pixi init debug && cd debug && pixi add 'python 3.13.*' coffea && pixi add --pypi atlas-schema
✔ Created /tmp/debug/pixi.toml
✔ Added python 3.13.*
✔ Added coffea >=2025.10.1,<2026
 WARN The package `coffea==2025.10.1` does not have an extra named `dask`
✔ Added atlas-schema >=0.4.1, <0.5
Added these as pypi-dependencies.
$ pixi list coffea
Package  Version    Build         Size       Kind   Source
coffea   2025.10.1  pyhcf101f3_0  193.7 KiB  conda  https://conda.anaconda.org/conda-forge/
[workspace]
channels = ["conda-forge"]
name = "debug"
platforms = ["linux-64"]
version = "0.1.0"

[tasks]

[dependencies]
python = "3.13.*"
coffea = ">=2025.10.1,<2026"

[pypi-dependencies]
atlas-schema = ">=0.4.1, <0.5"

This "makes sense" as coffea is coming from conda-forge and indeed no conda package has extras, but it is confusing to the user as the Python package coffea (which is a dependency of altas-schema) does have a [dask] extra defined.

Example:

$ rm -rf debug && pixi init debug && cd debug && pixi add 'python 3.13.*' && pixi add --pypi atlas-schema
✔ Created /tmp/debug/pixi.toml
✔ Added python 3.13.*
✔ Added atlas-schema >=0.4.1, <0.5
Added these as pypi-dependencies.

Issue description

I'm not sure if there's a great solution for this given the mixing of conda and Python packages, but raising more verbose warnings could be helpful.

This might also not really be a "bug" but more of a feature request for less confusing warnings.

Expected behavior

Either be able to understand that the Python package should take precedence over the conda package and resolve the extras that exist for the Python package, or have a more explicit and verbose warning to make it clear why the warning exists.

matthewfeickert avatar Oct 22 '25 15:10 matthewfeickert