Skip to content

Is it possible to declare conflicting dependencies against published dependencies? #16292

@winstxnhdw

Description

@winstxnhdw

Question

I want my users to be able to install my package with the default portable scipy but also give them the option to install the Intel MKL accelerated scipy. Trying to to do this without defining conflicts leads to a conflicts error. This doesn't seem to be documented either.

[project]
requires-python = ">=3.9"
dependencies = ["scipy>=1.11.0", "scipy>=1.13.0; python_version >= '3.12'"]

[project.optional-dependencies]
intel = ["scipy>=1.13.1; python_version >= '3.11' and python_version < '3.13'"]

[tool.uv]
conflicts = [[{ extra = "intel" }, { group = "default" }]]  # declare default is conflicting
index = [
    { name = "intel", url = "https://software.repos.intel.com/python/pypi", explicit = true },
    { name = "pypi", url = "https://pypi.org/simple" },
]

[tool.uv.sources]
scipy = [
    { index = "intel", extra = "intel" },
    { index = "pypi" },
]

Platform

No response

Version

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionAsking for clarification or support

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions