Skip to content

override-dependencies with different environment markers leads to error #9803

@mcschempp

Description

@mcschempp

Environment Info:

uv: 0.5.7
os: Ubuntu 22.04.5 LTS

Using the following paragraph in pyproject.toml ...

[tool.uv]
override-dependencies = [
    "some-lib @ file:///${PROJECT_ROOT}/libs/some-lib-1.4.1-cp311.cp312-none-linux_x86_64.whl; platform_machine == 'x86_64'",
    "some-lib @ file:///${PROJECT_ROOT}/libs/some-lib-1.4.1-cp311.cp312-none-linux_aarch64.whl; platform_machine == 'aarch64'",
]

... leads to the following error:
uv sync

error: Overrides contain conflicting URLs for package `some-lib`:
- file:///${PROJECT_ROOT}/libs/some-lib-1.4.1-cp311.cp312-none-linux_x86_64.whl
- file:///${PROJECT_ROOT}/libs/some-lib-1.4.1-cp311.cp312-none-linux_aarch64.whl

Not sure if I'm doing something wrong here, but imho this should work since the URLs are for different platforms.

EDIT:

I got it to work with

[tool.uv.sources]
some-lib = [
    { path = "libs/some-lib-1.4.1-cp311.cp312-none-linux_x86_64.whl", marker = "platform_machine == 'x86_64'" },
    { path = "libs/some-lib-1.4.1-cp311.cp312-none-linux_aarch64.whl", marker = "platform_machine == 'aarch64'" },
    { path = "", marker = "platform_machine != 'x86_64' and platform_machine != 'aarch64'" }

So this ticket can (probably) be closed

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions