Skip to content

Commit 243c9e0

Browse files
authored
Merge pull request #1358 from d-v-b/chore/fix-packaging
fix: use hatchling to build package
2 parents 82a9223 + 0183f44 commit 243c9e0

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

pyproject.toml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
[build-system]
2-
requires = ["setuptools>=60"]
3-
build-backend = "setuptools.build_meta"
2+
requires = ["hatchling"]
3+
build-backend = "hatchling.build"
44

55
[project]
66
name = "datajoint"
7-
# dynamically set in tools.setuptools.dynamic
87
dynamic = ["version"]
98
dependencies = [
109
"numpy",
@@ -20,7 +19,6 @@ dependencies = [
2019
"matplotlib",
2120
"faker",
2221
"urllib3",
23-
"setuptools",
2422
"pydantic-settings>=2.0.0",
2523
]
2624

@@ -79,7 +77,7 @@ Repository = "https://github.com/datajoint/datajoint-python"
7977
"Bug Tracker" = "https://github.com/datajoint/datajoint-python/issues"
8078
"Release Notes" = "https://github.com/datajoint/datajoint-python/releases"
8179

82-
[project.entry-points."console_scripts"]
80+
[project.scripts]
8381
dj = "datajoint.cli:cli"
8482
datajoint = "datajoint.cli:cli"
8583

@@ -211,12 +209,11 @@ module = [
211209
]
212210
ignore_errors = true
213211

214-
[tool.setuptools]
215-
packages = ["datajoint"]
216-
package-dir = {"" = "src"}
212+
[tool.hatch.version]
213+
path = "src/datajoint/version.py"
217214

218-
[tool.setuptools.dynamic]
219-
version = { attr = "datajoint.version.__version__"}
215+
[tool.hatch.build.targets.wheel]
216+
packages = ["src/datajoint"]
220217

221218
[tool.codespell]
222219
skip = ".git,*.pdf,*.svg,*.csv,*.ipynb,*.drawio"

tests/test_package.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from __future__ import annotations
2+
3+
import importlib.metadata
4+
5+
import datajoint as m
6+
7+
8+
def test_version():
9+
assert importlib.metadata.version("datajoint") == m.__version__

0 commit comments

Comments
 (0)