uv: uv refuses to resolve deps with dynamic SCM version, missing tags and cylic dependencies `A:dev -> B`, `B -> A`, hinting at name shadowing

It happens in several of my projects now. Proper issue as a follow-up of #7329.

Example:

Using CPython 3.10.15 interpreter at: /opt/hostedtoolcache/Python/3.10.15/x64/bin/python
Creating virtual environment at: .venv
  × No solution found when resolving dependencies:
  ╰─▶ Because only the following versions of mkdocstrings-python-legacy are
      available:
          mkdocstrings-python-legacy<=0.2.1
          mkdocstrings-python-legacy==0.2.2
          mkdocstrings-python-legacy==0.2.3
          mkdocstrings-python-legacy==0.2.4
      and mkdocstrings-python-legacy>=0.2.1,<=0.2.2 depends on your project,
      we can conclude that mkdocstrings-python-legacy>=0.2.1,<0.2.3 depends on
      your project.
      And because mkdocstrings-python-legacy>=0.2.3 depends on your project,
      we can conclude that mkdocstrings-python-legacy>=0.2.1 depends on your
      project.
      And because mkdocstrings[python-legacy] depends on
      mkdocstrings-python-legacy>=0.2.1 and your project requires
      mkdocstrings[python-legacy], we can conclude that your projects's
      requirements are unsatisfiable.

      hint: The package `mkdocstrings-python-legacy` depends on the package
      `mkdocstrings` but the name is shadowed by your project. Consider
      changing the name of the project.

Here uv claims that since mkdocstrings-python-legacy depends on mkdocstrings, and my project is named mkdocstrings, it cannot resolve deps. My project is mkdocstrings, it’s not shadowing it 😅

In this case, mkdocstrings depends on mkdocstrings-python-legacy as an extra (optional dependency).

[project.optional-dependencies]
python-legacy = ["mkdocstrings-python-legacy>=0.2.1"]

But I get the same error when project A depends on B as a development dependency.

I’m not sure if the non-editable mode is the issue here, as I cannot reproduce this behavior locally.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 33 (11 by maintainers)

Commits related to this issue

Most upvoted comments

OK so my previous technique for fetching tags was probably not working well:

    - name: Fetch all tags
      run: git fetch --depth=1 --tags

I replaced it with:

    - name: Checkout
      uses: actions/checkout@v4
      with:
        fetch-depth: 0
        fetch-tags: true

…and now it works 🥵

Thank you @pawamoy !

I hit this with a setuptools backend. I don’t think I would have easily solved the problem if I hadn’t found @pawamoy 's comment at https://github.com/astral-sh/uv/issues/8148#issuecomment-2408639333.

pip’s error message is clearer to me.

uv:

  × No solution found when resolving dependencies:
  ╰─▶ Because vws-python-mock==2025.2.18 depends on your project and
      vws-auth-tools[dev] depends on vws-python-mock==2025.2.18, we can
      conclude that vws-auth-tools[dev] depends on itself at an incompatible
      version (vws-auth-tools>=2024.7.12).
      And because your project requires vws-auth-tools[dev], we can conclude
      that your project's requirements are unsatisfiable.

      hint: The package `vws-python-mock` depends on the package
      `vws-auth-tools` but the name is shadowed by your project. Consider
      changing the name of the project.

pip:

The conflict is caused by:
    The user requested vws-auth-tools 0.0.post130+g2de0bcd (from /home/docs/checkouts/readthedocs.org/user_builds/vws-auth-tools/checkouts/1256)
    vws-auth-tools[dev] 0.0.post130+g2de0bcd depends on vws-auth-tools 0.0.post130+g2de0bcd (from /home/docs/checkouts/readthedocs.org/user_builds/vws-auth-tools/checkouts/1256)
    vws-python-mock 2025.2.18 depends on vws-auth-tools>=2024.7.12

From pip’s error I could work out that the issue is that at this stage the vws-auth-tools version is calculated as 0.0.something and that this is the issue.

Thank you!

Thank you for following up 🙏

Is there a bug in the error message hint then? Or is this resolved?