You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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__.py file 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:
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
We currently don't support dynamic versions in workspaces. They have a number of disadvantages, e.g., we have to run python code each time we want to determine the version of a package in the workspace, instead of just reading pyproject.toml, and we can't see when the version changes (there's no way for uv to tell that's it's about.py that changes the version). Instead of defining the version in about.py and having it dynamic in pyproject.toml, I recommend setting the version in pyproject.toml and reading it in about.py with importlib.metadata.version.
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
andd
(in the above) into another repository.Reproduction
In the above fork there are two branches:
version="0.1.0"
.__about__.py
file in the root of the project. In this file we have__version__=="1.0.0"
Now in a different project, I am trying to import both packages
c
andd
. The pyproject.toml is shown below: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 runninguv sync
oruv lock
After if I change the branch to
static-version
in the above toml then the install works completely fine.Related Issues
#8665
The text was updated successfully, but these errors were encountered: