summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2025-03-26 08:11:28 +0100
committerMartin Fischer <martin@push-f.com>2025-03-26 08:23:47 +0100
commit1c5b72f01ae4cac9740b43af6963e08c6277275c (patch)
treefb5d832f657e7e63f981f90387d5262a6278783c
parentbb1f5e7d97b5a2d63024071dbed91697e8bc8bcc (diff)
build: switch from setuptools to hatchling
For reproducible builds and also so that you no longer need `--config-settings editable_mode=compat` for pip install to make it work with Pyright. Neither of these concerns really affect osm-proposals since I am not publishing the package on PyPI nor does it expose any library but I have other packages where they do apply and to simplify maintenance I want to use the same build backend for all of my projects.
-rw-r--r--.gitignore7
-rw-r--r--default.nix2
-rw-r--r--pyproject.toml8
3 files changed, 12 insertions, 5 deletions
diff --git a/.gitignore b/.gitignore
index ecf61d6..b0b88e2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,8 +1,11 @@
*.pyc
*.egg-info/
-# created by `pip install . --config-settings editable_mode=compat`
-build
+# created by `python -m venv venv` (listed here for hatchling)
+venv/
+
+# created by `python -m build`
+dist/
# created by `nix-build`
result
diff --git a/default.nix b/default.nix
index fc9e1b0..f6cac5c 100644
--- a/default.nix
+++ b/default.nix
@@ -11,7 +11,7 @@ buildPythonApplication rec {
pyproject = true;
build-system = [
- setuptools
+ hatchling
];
dependencies = [
diff --git a/pyproject.toml b/pyproject.toml
index 1bad629..2a6d936 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -2,8 +2,12 @@
name = "osm-proposals"
version = "0.0.0"
-[tool.setuptools.packages.find]
-where = ["."]
+[build-system]
+requires = ["hatchling"]
+build-backend = "hatchling.build"
+
+[tool.hatch.build.targets.wheel]
+packages = ["osm_proposals"]
[project.scripts]
osm-proposals = "osm_proposals.proposals:run"