Skip to content

Cannot override dependency metadata of source dependency #13297

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
toslunar opened this issue May 5, 2025 · 0 comments
Open

Cannot override dependency metadata of source dependency #13297

toslunar opened this issue May 5, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@toslunar
Copy link

toslunar commented May 5, 2025

Summary

To reproduce, uv sync at a/ with the files below causes

  × No solution found when resolving dependencies:
  ╰─▶ Because only b==0.1.0 is available and b==0.1.0 depends on numpy<2, we can conclude that all versions of b
      depend on numpy<2.
      And because your project depends on b and numpy>=2, we can conclude that your project's requirements are
      unsatisfiable.

a/pyproject.toml

[project]
name = "a"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.12"
dependencies = ["b", "numpy>=2"]

[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[tool.uv.sources]
b = { path = "../b", editable = true }

[[tool.uv.dependency-metadata]]
name = "b"
requires-dist = ["numpy"]

a/src/a.py

...

b/pyproject.toml

[project]
name = "b"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.12"
dependencies = ["numpy<2"]

[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

b/src/b.py

...

Note that for PyPI dependency we can override requires-dist (numpy<1.29.0,>=1.22.4 in scipy==1.12.0) by

c/pyproject.toml

[project]
name = "c"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.12"
dependencies = ["scipy==1.12.0", "numpy>=2"]

[[tool.uv.dependency-metadata]]
name = "scipy"
requires-dist = ["numpy"]

Platform

Linux 5.15.167.4-microsoft-standard-WSL2 x86_64 GNU/Linux

Version

uv 0.7.2

Python version

3.12.9

@toslunar toslunar added the bug Something isn't working label May 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant