From 93838d37ba69c94c2d68e57c96c6d7006e4cd0e4 Mon Sep 17 00:00:00 2001 From: Davis Vann Bennett Date: Fri, 30 Jan 2026 15:12:12 +0100 Subject: [PATCH 1/2] add packaging test --- tests/test_package.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 tests/test_package.py diff --git a/tests/test_package.py b/tests/test_package.py new file mode 100644 index 000000000..b278dd1d4 --- /dev/null +++ b/tests/test_package.py @@ -0,0 +1,9 @@ +from __future__ import annotations + +import importlib.metadata + +import datajoint as m + + +def test_version(): + assert importlib.metadata.version("datajoint") == m.__version__ From 0183f44dcf54c3b6ba55f95eb089f403bd59b9d8 Mon Sep 17 00:00:00 2001 From: Davis Vann Bennett Date: Fri, 30 Jan 2026 15:38:54 +0100 Subject: [PATCH 2/2] use hatchling instead of setuptools to avoid missing building with missing packages --- pyproject.toml | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index fd33dfd53..ad67609ed 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,9 @@ [build-system] -requires = ["setuptools>=60"] -build-backend = "setuptools.build_meta" +requires = ["hatchling"] +build-backend = "hatchling.build" [project] name = "datajoint" -# dynamically set in tools.setuptools.dynamic dynamic = ["version"] dependencies = [ "numpy", @@ -20,7 +19,6 @@ dependencies = [ "matplotlib", "faker", "urllib3", - "setuptools", "pydantic-settings>=2.0.0", ] @@ -79,7 +77,7 @@ Repository = "https://github.com/datajoint/datajoint-python" "Bug Tracker" = "https://github.com/datajoint/datajoint-python/issues" "Release Notes" = "https://github.com/datajoint/datajoint-python/releases" -[project.entry-points."console_scripts"] +[project.scripts] dj = "datajoint.cli:cli" datajoint = "datajoint.cli:cli" @@ -211,12 +209,11 @@ module = [ ] ignore_errors = true -[tool.setuptools] -packages = ["datajoint"] -package-dir = {"" = "src"} +[tool.hatch.version] +path = "src/datajoint/version.py" -[tool.setuptools.dynamic] -version = { attr = "datajoint.version.__version__"} +[tool.hatch.build.targets.wheel] +packages = ["src/datajoint"] [tool.codespell] skip = ".git,*.pdf,*.svg,*.csv,*.ipynb,*.drawio"