prefix-dev / pixi

Package management made easy
https://pixi.sh
BSD 3-Clause "New" or "Revised" License
3.39k stars 193 forks source link

Pixi cannot resolve the compatible package if it is not of the latest major release #2354

Open skayred opened 1 month ago

skayred commented 1 month ago

Checks

Reproducible example

pyproject.toml

[tool.poetry]
name = "pixi-version-another-test"
version = "0.0.1a"
description = "Poetry-based project"
keywords = ["python", "utilities"]
authors = ["Mw <someone@gmail.com>"]

[tool.poetry.dependencies]
python = "^3.10"
pydicom = "^2.4.4"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

pixi.toml

[project]
name = "pixi-version"
channels = ["conda-forge"]
platforms = ["linux-64", "win-64"]

[host-dependencies]
python = "<=3.11"

[pypi-dependencies]
jsonargparse = { version = "*", extras = ["signatures"] }

[feature.own-packages.pypi-dependencies]
another = {path = "another", editable = true}

[environments]
default = {features = ["own-packages"], solve-group = "default"}
build = {features = ["own-packages"], solve-group="default"}

Issue description

With the provided files (directory another is inside the project directory and contains the provided pyproject.toml file), I can run the following command successfully:

pixi install --all

But when I try to add the pydicom into the Pixi project as well, I am facing the issue:

pixi add pydicom
  ⠂ default:linux-64     [00:00:00] loading repodata                                                                                                                                                                                                                            × failed to solve the pypi requirements of 'default' 'win-64'
  ├─▶ failed to resolve pypi dependencies
  ╰─▶ Because another==0.0.1a0 depends on pydicom>=2.4.4,<3.0.0 and pydicom==3.0.1, we can conclude that another==0.0.1a0 cannot be used.
      And because only another==0.0.1a0 is available and you require another, we can conclude that your requirements are unsatisfiable.

although there is a version that can be used. If I specify the version, package can be added properly:

pixi add pydicom==2.4.4
✔ Added pydicom==2.4.4

Expected behavior

Pixi should be able to resolve the 2.. version of the package when added without the explicitly mentioned version.

ruben-arts commented 4 weeks ago

The problem is that we can't retroactively change the "conda" dependencies.

Pixi works by solving all [(host-/build-)dependencies](conda) and then [pypi-dependencies] which are two different solvers. These two can't interact with each other on solve.

pixi add pydicom will add the latest version of pydicom but your pypi packages didn't like that as they demand a <3.

All the conda dependencies are injected into the pypi solve to avoid reinstalling or overwriting conda packages with pypi packages. Thus creating this error for you.

I'm sorry but we can't solve this yet.