From 8bb53c22be4477f4b430276cf893605acab45b86 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Sat, 19 Jul 2025 15:23:17 +0200 Subject: [PATCH] raise minimum supported Python version to 3.9 --- .github/workflows/ci-tests.yml | 2 +- Makefile | 2 +- docs/admin/Installation.md | 2 +- packaging/nominatim-api/pyproject.toml | 2 +- packaging/nominatim-db/pyproject.toml | 2 +- src/nominatim_api/logging.py | 5 +---- 6 files changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml index 4d555416..7a098ab6 100644 --- a/.github/workflows/ci-tests.yml +++ b/.github/workflows/ci-tests.yml @@ -119,7 +119,7 @@ jobs: if: matrix.dependencies == 'pip' - name: Python static typechecking - run: ../venv/bin/python -m mypy --strict --python-version 3.8 src + run: ../venv/bin/python -m mypy --strict --python-version 3.9 src working-directory: Nominatim if: matrix.dependencies == 'pip' diff --git a/Makefile b/Makefile index d6423add..2d501808 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,7 @@ build-api: tests: mypy lint pytest bdd mypy: - mypy --strict --python-version 3.8 src + mypy --strict --python-version 3.9 src pytest: pytest test/python diff --git a/docs/admin/Installation.md b/docs/admin/Installation.md index 2571de5d..99387ed6 100644 --- a/docs/admin/Installation.md +++ b/docs/admin/Installation.md @@ -27,7 +27,7 @@ For running Nominatim: * [PostgreSQL](https://www.postgresql.org) (12+ will work, 13+ strongly recommended) * [PostGIS](https://postgis.net) (3.0+ will work, 3.2+ strongly recommended) * [osm2pgsql](https://osm2pgsql.org) (1.8+) - * [Python 3](https://www.python.org/) (3.7+) + * [Python 3](https://www.python.org/) (3.9+) Furthermore the following Python libraries are required: diff --git a/packaging/nominatim-api/pyproject.toml b/packaging/nominatim-api/pyproject.toml index ca86f8a7..c2d42bd5 100644 --- a/packaging/nominatim-api/pyproject.toml +++ b/packaging/nominatim-api/pyproject.toml @@ -2,7 +2,7 @@ name = "nominatim-api" description = "A tool for building a database of OpenStreetMap for geocoding and for searching the database. Search library." readme = "README.md" -requires-python = ">=3.7" +requires-python = ">=3.9" license = 'GPL-3.0-or-later' maintainers = [ { name = "Sarah Hoffmann", email = "lonvia@denofr.de" }, diff --git a/packaging/nominatim-db/pyproject.toml b/packaging/nominatim-db/pyproject.toml index 3c99fd2a..80eec85f 100644 --- a/packaging/nominatim-db/pyproject.toml +++ b/packaging/nominatim-db/pyproject.toml @@ -2,7 +2,7 @@ name = "nominatim-db" description = "A tool for building a database of OpenStreetMap for geocoding and for searching the database. Database backend." readme = "README.md" -requires-python = ">=3.7" +requires-python = ">=3.9" license = 'GPL-3.0-or-later' maintainers = [ { name = "Sarah Hoffmann", email = "lonvia@denofr.de" }, diff --git a/src/nominatim_api/logging.py b/src/nominatim_api/logging.py index 64d43fdc..dccc69c1 100644 --- a/src/nominatim_api/logging.py +++ b/src/nominatim_api/logging.py @@ -2,7 +2,7 @@ # # This file is part of Nominatim. (https://nominatim.org) # -# Copyright (C) 2024 by the Nominatim developer community. +# Copyright (C) 2025 by the Nominatim developer community. # For a full list of authors see the git log. """ Functions for specialised logging with HTML output. @@ -106,9 +106,6 @@ class BaseLogger: except TypeError: return sqlstr - # Fixes an odd issue with Python 3.7 where percentages are not - # quoted correctly. - sqlstr = re.sub(r'%(?!\()', '%%', sqlstr) sqlstr = re.sub(r'__\[POSTCOMPILE_([^]]*)\]', r'%(\1)s', sqlstr) return sqlstr % params -- 2.39.5