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:
- CI job on tag 0.26.2: https://github.com/mkdocstrings/mkdocstrings/actions/runs/11307283146/job/31448849897 (“Install dependencies” step OK
- CI job on same commit (triggered via regular push): https://github.com/mkdocstrings/mkdocstrings/actions/runs/11307282883/job/31448849515 -> “Install dependencies” step fails
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
- Respect sources in overrides and constraints (#9455) ## Summary We still only respect overrides and constraints in the workspace root -- which we may want to change -- but overrides and constrain... — committed to astral-sh/uv by charliermarsh 2 years ago
- fix: Ignore constraints on main package (from dependencies), to allow resolving deps in forks/CI Issue-uv#8148: https://github.com/astral-sh/uv/issues/8148 — committed to pawamoy/copier-uv by pawamoy 2 years ago
- Try fetching tags to avoid uv issue Avoid https://github.com/astral-sh/uv/issues/8148 — committed to VWS-Python/vws-auth-tools by adamtheturtle 2 years ago
OK so my previous technique for fetching tags was probably not working well:
I replaced it with:
…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:pip:From
pip’s error I could work out that the issue is that at this stage thevws-auth-toolsversion is calculated as0.0.somethingand 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?