]> git.openstreetmap.org Git - nominatim.git/commitdiff
switch to symlink approach for packages
authorSarah Hoffmann <lonvia@denofr.de>
Wed, 19 Jun 2024 20:42:15 +0000 (22:42 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Wed, 26 Jun 2024 09:52:47 +0000 (11:52 +0200)
Needed to make building work from sdist and source directory.

15 files changed:
.gitignore
packaging/nominatim-api/COPYING [new symlink]
packaging/nominatim-api/pyproject.toml
packaging/nominatim-api/src [new symlink]
packaging/nominatim-core/COPYING [new symlink]
packaging/nominatim-core/data [new symlink]
packaging/nominatim-core/extra_src/nominatim_core/paths.py [moved from packaging/nominatim-core/src/nominatim_core/paths.py with 100% similarity]
packaging/nominatim-core/lib-sql [new symlink]
packaging/nominatim-core/pyproject.toml
packaging/nominatim-core/settings [new symlink]
packaging/nominatim-core/src [new symlink]
packaging/nominatim-db/COPYING [new symlink]
packaging/nominatim-db/pyproject.toml
packaging/nominatim-db/src [new symlink]
src/nominatim_core/version.py

index 0b0d2c45eaff6487422a8faaa83272ccf64a8bc9..8e91f1e5cd5fe96a1602c5ff6b559e1a83efd600 100644 (file)
@@ -1,5 +1,6 @@
 *.log
 *.pyc
+*.swp
 
 docs/develop/*.png
 
diff --git a/packaging/nominatim-api/COPYING b/packaging/nominatim-api/COPYING
new file mode 120000 (symlink)
index 0000000..7d29222
--- /dev/null
@@ -0,0 +1 @@
+../../COPYING
\ No newline at end of file
index 0e3f36d9e95a2fb4c645b73058a9519606b71f71..7d270021c2914d28cdec84892cbc23611f96b89e 100644 (file)
@@ -30,15 +30,12 @@ requires = ["hatchling"]
 build-backend = "hatchling.build"
 
 [tool.hatch.version]
-path = "../../src/nominatim_api/version.py"
+path = "src/nominatim_api/version.py"
 pattern = "NOMINATIM_API_VERSION = '(?P<version>[^']+)'"
 
-[tool.hatch.build.targets.sdist.force-include]
-"../../src/nominatim_db" = "nominatim_api"
-
-[tool.hatch.build.targets.sdist.sources]
-"src/nominatim_core" = "nominatim_api"
+[tool.hatch.build.targets.sdist]
+include = ["src/nominatim_api"]
 
 [tool.hatch.build.targets.wheel]
-packages = ["nominatim_api"]
+packages = ["src/nominatim_api"]
 
diff --git a/packaging/nominatim-api/src b/packaging/nominatim-api/src
new file mode 120000 (symlink)
index 0000000..a8d2a67
--- /dev/null
@@ -0,0 +1 @@
+../../src/
\ No newline at end of file
diff --git a/packaging/nominatim-core/COPYING b/packaging/nominatim-core/COPYING
new file mode 120000 (symlink)
index 0000000..7d29222
--- /dev/null
@@ -0,0 +1 @@
+../../COPYING
\ No newline at end of file
diff --git a/packaging/nominatim-core/data b/packaging/nominatim-core/data
new file mode 120000 (symlink)
index 0000000..e67b455
--- /dev/null
@@ -0,0 +1 @@
+../../data
\ No newline at end of file
diff --git a/packaging/nominatim-core/lib-sql b/packaging/nominatim-core/lib-sql
new file mode 120000 (symlink)
index 0000000..4b0ff01
--- /dev/null
@@ -0,0 +1 @@
+../../lib-sql/
\ No newline at end of file
index 19e86cdeb7fb978354f5887674ab7c528a290ee2..9c7af6514a2b8cebd92e398deeab6d72b8f83c40 100644 (file)
@@ -30,19 +30,31 @@ requires = ["hatchling"]
 build-backend = "hatchling.build"
 
 [tool.hatch.version]
-path = "../../src/nominatim_core/version.py"
-pattern = "NOMINATIM_CORE_VERSION = '(?P<version>[^']+)'"
+source = "code"
+path = "src/nominatim_core/version.py"
+expression = "NOMINATIM_CORE_VERSION"
 
-[tool.hatch.build.targets.sdist.force-include]
-"../../src/nominatim_core" = "nominatim_core"
-"../../lib-sql" = "nominatim_core/resources/lib-sql"
-"../../settings" = "nominatim_core/resources/settings"
-"../../data/country_osm_grid.sql.gz" = "nominatim_core/resources/country_osm_grid.sql.gz"
-"../../data/words.sql" = "nominatim_core/resources/words.sql"
-"src/nominatim_core/paths.py" = "nominatim_core/paths.py"
-
-[tool.hatch.build.targets.sdist.sources]
-"src/nominatim_core" = "nominatim_core"
+[tool.hatch.build.targets.sdist]
+include = [
+  "src/nominatim_core",
+  "lib-sql/**.sql",
+  "settings",
+  "data/words.sql",
+  "extra_src/nominatim_core/paths.py"
+]
+artifacts = [
+  "data/country_osm_grid.sql.gz"
+]
+exclude = [
+  "src/nominatim_core/paths.py"
+]
 
 [tool.hatch.build.targets.wheel]
-packages = ["nominatim_core"]
+packages = ["src/nominatim_core"]
+
+[tool.hatch.build.targets.wheel.force-include]
+"lib-sql" = "nominatim_core/resources/lib-sql"
+"settings" = "nominatim_core/resources/settings"
+"data/country_osm_grid.sql.gz" = "nominatim_core/resources/country_osm_grid.sql.gz"
+"data/words.sql" = "nominatim_core/resources/words.sql"
+"extra_src/nominatim_core/paths.py" = "nominatim_core/paths.py"
diff --git a/packaging/nominatim-core/settings b/packaging/nominatim-core/settings
new file mode 120000 (symlink)
index 0000000..51326e6
--- /dev/null
@@ -0,0 +1 @@
+../../settings/
\ No newline at end of file
diff --git a/packaging/nominatim-core/src b/packaging/nominatim-core/src
new file mode 120000 (symlink)
index 0000000..929cb3d
--- /dev/null
@@ -0,0 +1 @@
+../../src
\ No newline at end of file
diff --git a/packaging/nominatim-db/COPYING b/packaging/nominatim-db/COPYING
new file mode 120000 (symlink)
index 0000000..7d29222
--- /dev/null
@@ -0,0 +1 @@
+../../COPYING
\ No newline at end of file
index f7d0502b8028e4a01244ee6d86b21b9eefe13f2a..3e4a9a4f16db57dbe4489c401cbc86e640a4abc6 100644 (file)
@@ -30,19 +30,14 @@ requires = ["hatchling"]
 build-backend = "hatchling.build"
 
 [tool.hatch.version]
-path = "../../src/nominatim_db/version.py"
+path = "src/nominatim_db/version.py"
 pattern = "NOMINATIM_VERSION = parse_version.'(?P<version>[^-]+)"
 
-[tool.hatch.build.targets.sdist.force-include]
-"../../src/nominatim_db" = "nominatim_db"
-
-[tool.hatch.build.targets.sdist.sources]
-"src/nominatim_core" = "nominatim_db"
-"scripts" = "scripts"
+[tool.hatch.build.targets.sdist]
+include = ["src/nominatim_db", "scripts"]
 
 [tool.hatch.build.targets.wheel]
-packages = ["nominatim_db"]
+packages = ["src/nominatim_db"]
 
 [tool.hatch.build.targets.wheel.shared-scripts]
 "scripts" = "/"
-
diff --git a/packaging/nominatim-db/src b/packaging/nominatim-db/src
new file mode 120000 (symlink)
index 0000000..929cb3d
--- /dev/null
@@ -0,0 +1 @@
+../../src
\ No newline at end of file
index 64e18b1694b7c5beb6f16ff386ddbca69a71192b..91193fa44b207b57e388d3ea12f77a6d48e71559 100644 (file)
@@ -9,7 +9,8 @@ Version information for the Nominatim core package.
 """
 from typing import NamedTuple, Optional
 
-NOMINATIM_CORE_VERSION = '4.4.99'
+__version__ = '4.4.99'
+NOMINATIM_CORE_VERSION = __version__
 
 class NominatimVersion(NamedTuple):
     """ Version information for Nominatim. We follow semantic versioning.