Skip to content

uv build in a workspace: output directory is weird/inconsistent #13914

@dimaqq

Description

@dimaqq

Summary

I have a workspace with:

  • a package at top level
  • a sub-package under ./testing

When building is run at top level:

  • uv build builds the top-level package, output in ./dist, aka repo/dist
  • uv build testing builds the sub-package, output in ./dist, aka repo/dist
  • uv build testing/ builds the sub-package, output in ./testing/dist, aka repo/testing/dist

The difference between the last two is kinda weird.

Likewise, when building in the subdirectory:

  • uv build builds the sub-package, output in ../dist, aka repo/dist
  • uv build . builds the sub-package, output in ../dist, aka repo/dist
  • uv build ./ builds the sub-package, output in ./dist, aka repo/testing/dist

Could it be that uv treats an arg as a name and arg/ as a location?
(note that in my case, the subdirectory name doesn't match the package name, so that's probably not the case).

For the subdirectory case, I'm not even sure what the correct behaviour should be.
../dist suggests that uv groks that this is a workspace... or maybe it's a bug?
./dist is backwards-compatible... though one may argue that it's against workspace ethos?

Finally:

  • uv build --all at top-level builds all packages with output in ./dist aka repo/dist

Platform

macos

Version

uv 0.7.12 (Homebrew 2025-06-06)

Python version

any

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions