Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System requirements violation (macOS version) when resolving pypi dependencies #3275

Open
2 tasks done
uwu-420 opened this issue Mar 5, 2025 · 4 comments
Open
2 tasks done
Labels
🐞 bug Something isn't working 🐍 pypi Issue related to PyPI dependencies

Comments

@uwu-420
Copy link

uwu-420 commented Mar 5, 2025

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

  • Create a project with this pyproject.toml
[project]
name = "pixi-test"
requires-python = ">=3.13"
version = "0.1.0"
dependencies = ["numpy>=2.2.3,<3"]

[tool.pixi.project]
channels = ["conda-forge"]
platforms = ["osx-64", "osx-arm64"]

[tool.pixi.feature.osx-64]
platforms = ["osx-64"]
system-requirements = {macos = "10.14"}

[tool.pixi.feature.osx-arm64]
platforms = ["osx-arm64"]
system-requirements = {macos = "14.0"}

[tool.pixi.environments]
osx-64 = {features = ["osx-64"], solve-group = "default"}
osx-arm64 = {features = ["osx-arm64"], solve-group = "default"}
  • Run pixi install
  • The resulting (simplified) lockfile looks like this
version: 6
environments:
  default:
    channels:
    - url: https://conda.anaconda.org/conda-forge/
    indexes:
    - https://pypi.org/simple
    packages:
      osx-64:
      # ...
      - pypi: https://[...]/numpy-2.2.3-cp313-cp313-macosx_10_13_x86_64.whl
      osx-arm64:
      # ...
      - pypi: https://[...]/numpy-2.2.3-cp313-cp313-macosx_11_0_arm64.whl
  osx-64:
    channels:
    - url: https://conda.anaconda.org/conda-forge/
    indexes:
    - https://pypi.org/simple
    packages:
      osx-64:
      # ...
      - pypi: https://[...]/numpy-2.2.3-cp313-cp313-macosx_14_0_x86_64.whl
  osx-arm64:
    channels:
    - url: https://conda.anaconda.org/conda-forge/
    indexes:
    - https://pypi.org/simple
    packages:
      osx-arm64:
      # ...
      - pypi: https://[...]/numpy-2.2.3-cp313-cp313-macosx_14_0_arm64.whl
packages:
# ...

Issue description

My goal was to specify different macos system-requirements for osx-64 and osx-arm64 because currently it's impossible to set it to macOS 10.14 because that does not exist for osx-arm64.

IIUC a workaround would be what I tried in this pyproject.toml, i.e. creating separate environments for osx-64 and osx-arm64 and setting the macos in their corresponding system-requirements.

But doing that revealed some bogus behavior when resolving pypi-dependencies. Here I chose numpy, because it offers wheels for different macOS versions. For the osx-64 environment I want to support macOS 10.14+ but the resolver picks a wheel for this environment that requires macOS 14.0+ which violates this requirement.

Expected behavior

For the osx-64 environment the resolver should have chosen numpy-2.2.3-cp313-cp313-macosx_10_13_x86_64.whl instead of numpy-2.2.3-cp313-cp313-macosx_14_0_x86_64.whl.

@ruben-arts ruben-arts added 🐍 pypi Issue related to PyPI dependencies 🐞 bug Something isn't working labels Mar 5, 2025
@tdejager
Copy link
Contributor

tdejager commented Mar 6, 2025

Thanks for the report, that definitely looks like a bug to me!

@tdejager
Copy link
Contributor

tdejager commented Mar 7, 2025

I guess we might also need an issue to the system-requirement for osx-arm64 and osx-64 seperately. wdyt @ruben-arts?

@ruben-arts
Copy link
Contributor

@tdejager do you mean this issue?: #2714

@uwu-420
Copy link
Author

uwu-420 commented Mar 10, 2025

I have another example that probably fits this issue

[project]
name = "pixi-test"
requires-python = ">=3.13,<3.14"
version = "0.1.0"
dependencies = []

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

[tool.pixi.pypi-dependencies]
numpy = ">=2.2.3,<3"

[tool.pixi.system-requirements]
macos = "14.0"

[tool.pixi.feature.foo.system-requirements]
macos = "11.0"

[tool.pixi.environments]
foo = { features = ["foo"] }

where we get a violating numpy wheel for the foo environment.
I think the macos = "11.0" line isn't really considered at all by pixi. I can give it any garbage value and nothing will complain.
If it is intentional that a system requirement set by a feature is ignored when there's already something in the general system requirements then I'd say a warning that it's ignored would be good for the UX.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working 🐍 pypi Issue related to PyPI dependencies
Projects
None yet
Development

No branches or pull requests

3 participants