-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Description
UV Version
0.4.29
Issue
Currently I am experiencing an issue with transitive dependencies in workspaces when using a dynamic version. I have created a minimal example with a fork of https://github.com/konstin/workspace-git-path-dep-test. The fork is here https://github.com/ajohnson5/workspace-git-path-dep-test/tree/dynamic-version.
I am trying to import two modules (which are workspaces), one of which depends on the other, similar to packages c and d (in the above) into another repository.
Reproduction
In the above fork there are two branches:
- static-version: Same as the main branch with each package having an explicit version number defined in their pyproject.toml files such as
version="0.1.0". - dynamic-version: Each package has a dynamic version, similar to below with a
__about__.pyfile in the root of the project. In this file we have__version__=="1.0.0"
[project]
name = "d"
dynamic=["version"]
[tool.hatch.version]
path = "../../__about__.py"
Now in a different project, I am trying to import both packages c and d. The pyproject.toml is shown below:
[project]
name = "example-project"
version = "0.1.0"
requires-python=">=3.11, <=3.12"
dependencies = [
"c",
"d",
]
[tool.uv.sources]
c = { git = "https://github.com/ajohnson5/workspace-git-path-dep-test.git", subdirectory="packages/c", branch="dynamic-version"}
d = { git = "https://github.com/ajohnson5/workspace-git-path-dep-test.git", subdirectory="packages/d", branch="dynamic-version"}
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["src/example_project"]
Note that between any uv commands I am doing a complete fresh run, uv cache clean, rm -rf .venv and removing the uv lock.
If I use the dynamic-version branch I get the following error when running uv sync or uv lock
error: Requirements contain conflicting URLs for package `d`:
- file:///Users/a-user/.cache/uv/git-v0/checkouts/c63672d311baa9b4/d116d88/packages/d
- git+https://github.com/ajohnson5/workspace-git-path-dep-test.git@dynamic-version#subdirectory=packages/d
After if I change the branch to static-version in the above toml then the install works completely fine.