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'm currently testing out the workspace features of uv, and have come across something unexpected.
When running uv run ... in a workspace member, it will install any new packages from the member's dependencies into the venv, but it will not remove any dependencies left-over from other members. That can lead to an issue where two members needs a dependency, and it's only listed for one, but unless you manually run uv sync every time you move between them you will not notice.
I've set up a small project to illustrate, with two subpackages:
[project]
name = "project-a"version = "0.1.0"description = "Add your description here"readme = "README.md"requires-python = ">=3.12"dependencies = ["pyhumps>=3.8.0"]
and project-b does not:
[project]
name = "project-b"version = "0.1.0"description = "Add your description here"readme = "README.md"requires-python = ">=3.12"dependencies = []
Both have a similar hello.py test script that uses pyhumps:
fromhumpsimportpascalizedefmain():
print(f"Hello from {pascalize('project-a')}!")
if__name__=="__main__":
main()
If I run uv run hello.py in project-a first, uv run hello.py will work in project-b after - until I manually run uv sync and then it stops working.
This same behavior is there for dev dependencies as well. Say if one member dev-depends on pytest, running uv run pytest anywhere else in the workspace works until manually synced.
This can of course be worked around by always running uv sync, but knowing myself I will forget to do that.
The text was updated successfully, but these errors were encountered:
I'm currently testing out the workspace features of uv, and have come across something unexpected.
When running
uv run ...
in a workspace member, it will install any new packages from the member's dependencies into the venv, but it will not remove any dependencies left-over from other members. That can lead to an issue where two members needs a dependency, and it's only listed for one, but unless you manually runuv sync
every time you move between them you will not notice.I've set up a small project to illustrate, with two subpackages:
where
project-a
has a dependency onpyhumps
:and
project-b
does not:Both have a similar
hello.py
test script that usespyhumps
:If I run
uv run hello.py
inproject-a
first,uv run hello.py
will work inproject-b
after - until I manually runuv sync
and then it stops working.This same behavior is there for dev dependencies as well. Say if one member dev-depends on
pytest
, runninguv run pytest
anywhere else in the workspace works until manually synced.This can of course be worked around by always running
uv sync
, but knowing myself I will forget to do that.The text was updated successfully, but these errors were encountered: