From d98928d544be2f7a05b8d0c82e0f1467b9447eda Mon Sep 17 00:00:00 2001 From: Elvis Pranskevichus Date: Mon, 9 Dec 2024 16:46:04 -0800 Subject: [PATCH] Upgrade to PostGIS 3.5.0 --- .gitignore | 1 + MANIFEST.toml | 2 +- README.md | 2 +- postgis | 2 +- postgis.edgeql | 4 ++-- scripts/gen_ext_postgis.py | 7 ++++--- scripts/postgis.template.edgeql | 4 ++-- tests/test_edgeql_postgis.py | 2 +- 8 files changed, 13 insertions(+), 11 deletions(-) mode change 100644 => 100755 scripts/gen_ext_postgis.py diff --git a/.gitignore b/.gitignore index bac480d..084a094 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ build postgis--*.zip *.pyc __pycache__ +/.venv diff --git a/MANIFEST.toml b/MANIFEST.toml index fdfb3e9..878fcf5 100644 --- a/MANIFEST.toml +++ b/MANIFEST.toml @@ -1,4 +1,4 @@ name = "postgis" -version = "3.4.3" +version = "3.5.0" files = ["postgis.edgeql"] postgres_files = "pg" diff --git a/README.md b/README.md index 52cefb0..e776236 100644 --- a/README.md +++ b/README.md @@ -6,5 +6,5 @@ from inside an edgedb development venv. To build, install, and test into a dev env: - ``make`` - ``make zip`` -- ``edb load-ext postgis--3.4.3.zip`` +- ``edb load-ext postgis--3.5.0.zip`` - ``edb test tests/test_edgeql_postgis.py`` diff --git a/postgis b/postgis index e365945..d2c3ca4 160000 --- a/postgis +++ b/postgis @@ -1 +1 @@ -Subproject commit e36594574671877ca6178c944e6d430f87f310bf +Subproject commit d2c3ca48e648571deda98d8e4d9bb4e2c82fde16 diff --git a/postgis.edgeql b/postgis.edgeql index 7defcc3..5f0d93b 100644 --- a/postgis.edgeql +++ b/postgis.edgeql @@ -17,9 +17,9 @@ # -create extension package postgis version '3.4.3' { +create extension package postgis version '3.5.0' { set ext_module := "ext::postgis"; - set sql_extensions := ["postgis >=3.4.0,<4.0.0"]; + set sql_extensions := ["postgis >=3.5.0,<4.0.0"]; set sql_setup_script := $$ -- Make it possible to have `!=`, `?!=`, and `not in` for geometry diff --git a/scripts/gen_ext_postgis.py b/scripts/gen_ext_postgis.py old mode 100644 new mode 100755 index f3a0a08..4353c46 --- a/scripts/gen_ext_postgis.py +++ b/scripts/gen_ext_postgis.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python # # This source file is part of the EdgeDB open source project. # @@ -403,7 +404,7 @@ def parse_postgis_extension( for fpath in root.glob('postgis*.sql'): name = fpath.name # We might scan more postgis extension files - if name in {'postgis--3.4.3.sql'}: + if name in {'postgis--3.5.0.sql'}: with open(fpath, mode='rt') as f: sql_query = ''.join( line for line in f.readlines() @@ -830,7 +831,7 @@ def rst_print_categories(func_categories, file=None): def main(show_broken=False): - base_build = pathlib.Path('build').resolve() + base_build = pathlib.Path(__file__).parent.parent.resolve() # Used to generate both .edgeql and .rst functions = collections.defaultdict(list) aggregates = collections.defaultdict(list) @@ -919,7 +920,7 @@ def main(show_broken=False): # Create ext_postgis directory in `build` for output files for the # extension and the docs. - build_dir = pathlib.Path('build').resolve() / 'ext_postgis' + build_dir = base_build if not build_dir.exists(): os.makedirs(build_dir) diff --git a/scripts/postgis.template.edgeql b/scripts/postgis.template.edgeql index 3db9438..e6d462c 100644 --- a/scripts/postgis.template.edgeql +++ b/scripts/postgis.template.edgeql @@ -17,9 +17,9 @@ # -create extension package postgis version '3.4.3' { +create extension package postgis version '3.5.0' { set ext_module := "ext::postgis"; - set sql_extensions := ["postgis >=3.4.3,<4.0.0"]; + set sql_extensions := ["postgis >=3.5.0,<4.0.0"]; set sql_setup_script := $$ -- Make it possible to have `!=`, `?!=`, and `not in` for geometry diff --git a/tests/test_edgeql_postgis.py b/tests/test_edgeql_postgis.py index 3878b50..ff49ec0 100644 --- a/tests/test_edgeql_postgis.py +++ b/tests/test_edgeql_postgis.py @@ -124,7 +124,7 @@ def get_setup_script(cls): with open(os.path.join(root, 'edb/lib/ext/postgis.edgeql')) as f: contents = f.read() to_add = ''' - drop extension package postgis version '3.4.3'; + drop extension package postgis version '3.5.0'; ''' + contents splice = '__internal_testmode := true;' res = res.replace(splice, splice + to_add)