Skip to content

Commit 906d6fc

Browse files
mwojtyczkaasnare
andauthored
Fix wheel and sdist build configuration (#377)
## Summary Build artifacts is broken after switching from `hatch` to `uv`: the wheel is coming out empty, and the sdist is unpacked into a `src/` directory instead of a clean project layout. Split the Hatch config into per-target sections: - `[tool.hatch.build.targets.wheel]` — sets `packages = ["src/databricks"]` so the `databricks.labs.blueprint` package is actually included in the wheel. - `[tool.hatch.build.targets.sdist]` — uses `only-include = ["src", "README.md", "LICENSE", "NOTICE"]` so the sdist contains the source tree and metadata at the top level. ## Test plan - [x] `uv build` produces a non-empty wheel containing `databricks/labs/blueprint/...` - [x] sdist unpacks with `src/`, `README.md`, `LICENSE`, `NOTICE` at the top level - [x] `pip install` the wheel in a fresh venv and `import databricks.labs.blueprint` succeeds --------- Co-authored-by: Andrew Snare <andrew.snare@databricks.com>
1 parent 51e52cd commit 906d6fc

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

pyproject.toml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,20 @@ requires = [
6666
]
6767
build-backend = "hatchling.build"
6868

69-
[tool.hatch.build]
70-
sources = ["src"]
71-
include = ["src"]
69+
[tool.hatch.build.targets.sdist]
70+
only-include = [
71+
"/.build-constraints.txt",
72+
"/README.*",
73+
"/LICEN[CS]E",
74+
"/NOTICE",
75+
"/pyproject.toml",
76+
"/src/",
77+
"/tests/",
78+
"/uv.lock",
79+
]
80+
81+
[tool.hatch.build.targets.wheel]
82+
packages = ["src/databricks"]
7283

7384
[tool.hatch.version]
7485
path = "src/databricks/labs/blueprint/__about__.py"

0 commit comments

Comments
 (0)