[Python] uv dependency resolution error: "conflicting URLs for package" with pyproject.toml...

Discussão em 'Python' iniciado por Stack, Agosto 19, 2025.

  1. Stack

    Stack Membro Participativo

    I am using uv to manage my dependency. My pyproject.toml looks like

    [project]
    name = "project_1"
    version = "2.3.0"
    description = "My Project description."
    requires-python = ">=3.12"

    dependencies = [
    "bleach==6.2.0",
    "dataclass-wizard==0.27.0",
    "pymilvus==2.5.8",
    "pymilvus-model==0.3.2",
    ]

    [project.optional-dependencies]
    partb = [
    "langchain-openai==0.2.8",
    "opentelemetry-exporter-otlp==1.29.0",
    ]
    parta = [
    "overrides==7.7.0",
    "opentelemetry-api==1.29.0",
    ]
    all = [
    "my-project[parta,partb]",
    ]

    [tool.uv.sources]
    my-project = { workspace = true }

    [tool.setuptools]
    package-dir = {"" = "src"}
    include-package-data = true

    [tool.setuptools.packages.find]
    where = ["src"]



    This was working well with older version of uv i.e.

    $ uv --version
    uv 0.7.4


    But in latest version they decided to change this and now I am getting error

    uv pip install -e .[all]
    × Failed to resolve dependencies for `my-project` (v2.3.0)
    ╰─▶ Requirements contain conflicting URLs for package `my-project`:
    - file:///home/User/Documents/my-project


    The suggestion I am getting are to use my-project[partb, parta] and remove my-project[all] from the support. But since I already have good user base who are familiar with this flow, I don't want to break this.

    Another thing suggested is to maintain separate all block which will have copy of both parta and partb which is not easy to maintain.

    How to make it work?

    Continue reading...

Compartilhe esta Página