Skip to content

Commit 8f79dde

Browse files
committed
Phase 1.4: Migrate build backend from setuptools to hatchling (#109)
- Replace setuptools with hatchling as build backend - Hatchling is git-aware: sdist now includes all tracked files by default Note: This work was completed with AI assistance (Claude Code).
1 parent d99f219 commit 8f79dde

File tree

1 file changed

+24
-13
lines changed

1 file changed

+24
-13
lines changed

pyproject.toml

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[build-system]
2-
requires = ["setuptools>=80.9.0", "wheel"]
3-
build-backend = "setuptools.build_meta"
2+
requires = ["hatchling"]
3+
build-backend = "hatchling.build"
44

55
[project]
66
name = "cfxdb"
@@ -95,17 +95,28 @@ Documentation = "https://cfxdb.readthedocs.io"
9595
Repository = "https://github.com/crossbario/cfxdb"
9696
Issues = "https://github.com/crossbario/cfxdb/issues"
9797

98-
[tool.setuptools]
99-
zip-safe = true
100-
include-package-data = true
101-
102-
[tool.setuptools.packages.find]
103-
where = ["src"]
104-
include = ["cfxdb*"]
105-
exclude = ["tests*", "docs*", ".ai*", ".cicd*", "work*"]
106-
107-
[tool.setuptools.package-data]
108-
cfxdb = ["py.typed"]
98+
# Hatchling build configuration
99+
[tool.hatch.build.targets.wheel]
100+
packages = ["src/cfxdb"]
101+
102+
# Include non-Python files in the wheel
103+
[tool.hatch.build.targets.wheel.force-include]
104+
# Include py.typed marker
105+
"src/cfxdb/py.typed" = "cfxdb/py.typed"
106+
107+
[tool.hatch.build.targets.sdist]
108+
# By default, hatchling includes all git-tracked files
109+
# Exclude build artifacts from sdist
110+
exclude = [
111+
"/.github",
112+
"/docs/_build",
113+
"/.venvs",
114+
"/.uv-cache",
115+
"/.coverage",
116+
"/.pytest_cache",
117+
"/.mypy_cache",
118+
"/.ruff_cache",
119+
]
109120

110121
# Ruff configuration (replaces flake8, black, yapf)
111122
[tool.ruff]

0 commit comments

Comments
 (0)