Skip to content

pycross cannot disambiguate between different versions of the same package in uv.lock #205

@aw632

Description

@aw632

I haven't had time to produce a minimal example, but, suppose:

  1. You have a pyproject.toml that supports Python >=3.10,<3.14
  2. You add numpy as a dependency
  3. uv will resolve two versions of numpy, one for Python <3.12 and one for Python >=3.12, and have two numpy packages in uv.lock with 2 different versions.
  4. You run Pycross for Python 3.10
  5. Pycross pulls the wrong numpy version, not the one intended for Python 3.10, and the bazel build fails.

We should support resolution markers here:

[[package]]
name = "numpy"
version = "2.3.4"
source = { registry = "https://pypi.org/simple" }
resolution-markers = [
    "python_full_version >= '3.13' and platform_machine == 'aarch64' and sys_platform == 'linux'",
    "python_full_version == '3.12.*' and platform_machine == 'aarch64' and sys_platform == 'linux'",
    "python_full_version >= '3.13' and platform_machine != 'aarch64' and sys_platform == 'linux'",
    "python_full_version == '3.12.*' and platform_machine != 'aarch64' and sys_platform == 'linux'",
    "python_full_version == '3.11.*' and platform_machine == 'aarch64' and sys_platform == 'linux'",
    "python_full_version == '3.11.*' and platform_machine != 'aarch64' and sys_platform == 'linux'",
]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions