Support multiple constraints pypi dependencies
zen-xu opened this issue · comments
Checks
-
I have checked that this issue has not already been reported.
-
I have confirmed this bug exists on the latest version of pixi, using
pixi --version
.
Reproducible example
# pyproject.toml
[project]
authors = [{ name = "ZhengYu, Xu", email = "zen-xu@outlook.com" }]
description = "Add a short description here"
name = "playground"
requires-python = ">=3.7,<3.12"
version = "0.1.0"
dependencies = [
'pyarrow >=11.0.0; python_version >= "3.7" and python_version < "3.8"',
'pyarrow ==16.1.0; python_version >= "3.8" and python_version < "3.12"',
]
[tool.pixi.project]
channels = ["conda-forge"]
platforms = ["osx-64"]
[tool.pixi.feature.py311.dependencies]
python = "3.11.*"
[tool.pixi.feature.py37.dependencies]
python = "3.7.*"
[tool.pixi.tasks]
[tool.pixi.environments]
default = { features = ["py311"], solve-group = "py311" }
py311 = { features = ["py311"], solve-group = "py311" }
py37 = { features = ["py37"], solve-group = "py37" }
Issue description
I am installing different versions of pyarrow by restricting the python_version, but it seems that pixi fail to resolve it.
![image](https://private-user-images.githubusercontent.com/38552291/357324181-c6d424d7-4a39-440a-8c7f-08066c128eb6.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQxNTY3ODgsIm5iZiI6MTcyNDE1NjQ4OCwicGF0aCI6Ii8zODU1MjI5MS8zNTczMjQxODEtYzZkNDI0ZDctNGEzOS00NDBhLThjN2YtMDgwNjZjMTI4ZWI2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODIwVDEyMjEyOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTdhNTczYTljZDQzMGQ4YWQ0YzhmNWViMmUzOTYzNDkyZTYxN2NkZjZjN2RjMDRhNDEyOTdlYzZhZmE1MzQxNzkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.W5B_o-EeresZ_mcaNOQTETjOpNo6d8Bx-T5XAWOAaWM)
Expected behavior
Correctly resolve the dependencies.
pixi/crates/pixi_manifest/src/pyproject.rs
Lines 268 to 273 in b117b6a
pixi/crates/pixi_manifest/src/target.rs
Lines 219 to 237 in b117b6a
pixi/crates/pixi_manifest/src/pypi/pypi_requirement.rs
Lines 34 to 38 in b117b6a
It seems that pixi only considers the package version and extras in pyproject dependency.
Indeed, we have to add env marker support.