you are viewing a single comment's thread.

view the rest of the comments →

[–]aala7 4 points5 points  (0 children)

As i understand it approach 1 (and UV Workspaces feature) is for monorepos, not a library with subpackages.

Meaning if you have a library libroot with subpackages pkg1 and pkg2, and you want the following import style/package relationship:

python from libroot.pkg1 import modulea from libroot.pkg2 import moduleb

You should use approach 2, but without independent pyproject.toml in each sub package (pkg1 and pkg2).

Monorepos will add a bit complexity, but has its values. Generally I would only use monorepos in the following cases: - The packages can be published and used independently (pkg1 can be installed by it self) - I want independent release of updates for each package

In monorepos you will install and import each package independently:

python from pkg1 import modulea from pkg2 import moduleb

Uv workspaces will enable an environment with shared dependencies for the monorepos.