python - Build a monorepo with UV and common packages - Stack Overflow

admin2025-04-16  4

I am building a monorepo that manages multiple projects with independent requirements. I am using UV to manage libraries in a monorepo and using databricks asset bundle to deploy the projects as workflows. This is the folder structure:

datalab/
│── databricks_init_script.sh
│── databricks.yml
│── databricks_init_script.sh
│── projects
│   └── project1
│       ├── pyproject.toml
│       ├── notebooks
│       └── src
│──shared
│   ├── pyproject.toml
│   ├── src/
│   └── <other necessary files>

In the toml file within each project I'm including the shared modules requirements with

dependencies = [
  "data-lab-shared"
]
[tool.uv.sources]
data-lab-shared = {path = "../../shared"}

And in the toml file in the shared folder I'm including this build-system

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

In the init script I am build a wheel file and install the packages using uv build and pip install the wheel file.

The problem is that the packages specified in the shared folder are not being installed. What would be a correct way to make sure that these packages are installed?

转载请注明原文地址:http://www.anycun.com/QandA/1744750197a87081.html