mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-16 15:47:58 +00:00
Merge pull request #3785 from lonvia/raise-python-to-39
Raise minimum required Python version to 3.9
This commit is contained in:
10
.github/workflows/ci-tests.yml
vendored
10
.github/workflows/ci-tests.yml
vendored
@@ -44,11 +44,13 @@ jobs:
|
|||||||
postgresql: 12
|
postgresql: 12
|
||||||
lua: '5.1'
|
lua: '5.1'
|
||||||
dependencies: pip
|
dependencies: pip
|
||||||
|
python: '3.9'
|
||||||
- flavour: ubuntu-24
|
- flavour: ubuntu-24
|
||||||
ubuntu: 24
|
ubuntu: 24
|
||||||
postgresql: 17
|
postgresql: 17
|
||||||
lua: '5.3'
|
lua: '5.3'
|
||||||
dependencies: apt
|
dependencies: apt
|
||||||
|
python: 'builtin'
|
||||||
|
|
||||||
runs-on: ubuntu-${{ matrix.ubuntu }}.04
|
runs-on: ubuntu-${{ matrix.ubuntu }}.04
|
||||||
|
|
||||||
@@ -75,6 +77,12 @@ jobs:
|
|||||||
key: osm2pgsql-bin-22-1
|
key: osm2pgsql-bin-22-1
|
||||||
if: matrix.ubuntu == '22'
|
if: matrix.ubuntu == '22'
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: ${{ matrix.python }}
|
||||||
|
if: matrix.python != 'builtin'
|
||||||
|
|
||||||
- name: Compile osm2pgsql
|
- name: Compile osm2pgsql
|
||||||
run: |
|
run: |
|
||||||
if [ ! -f /usr/local/bin/osm2pgsql ]; then
|
if [ ! -f /usr/local/bin/osm2pgsql ]; then
|
||||||
@@ -119,7 +127,7 @@ jobs:
|
|||||||
if: matrix.dependencies == 'pip'
|
if: matrix.dependencies == 'pip'
|
||||||
|
|
||||||
- name: Python static typechecking
|
- 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
|
working-directory: Nominatim
|
||||||
if: matrix.dependencies == 'pip'
|
if: matrix.dependencies == 'pip'
|
||||||
|
|
||||||
|
|||||||
2
Makefile
2
Makefile
@@ -18,7 +18,7 @@ build-api:
|
|||||||
tests: mypy lint pytest bdd
|
tests: mypy lint pytest bdd
|
||||||
|
|
||||||
mypy:
|
mypy:
|
||||||
mypy --strict --python-version 3.8 src
|
mypy --strict --python-version 3.9 src
|
||||||
|
|
||||||
pytest:
|
pytest:
|
||||||
pytest test/python
|
pytest test/python
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ For running Nominatim:
|
|||||||
* [PostgreSQL](https://www.postgresql.org) (12+ will work, 13+ strongly recommended)
|
* [PostgreSQL](https://www.postgresql.org) (12+ will work, 13+ strongly recommended)
|
||||||
* [PostGIS](https://postgis.net) (3.0+ will work, 3.2+ strongly recommended)
|
* [PostGIS](https://postgis.net) (3.0+ will work, 3.2+ strongly recommended)
|
||||||
* [osm2pgsql](https://osm2pgsql.org) (1.8+)
|
* [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:
|
Furthermore the following Python libraries are required:
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
name = "nominatim-api"
|
name = "nominatim-api"
|
||||||
description = "A tool for building a database of OpenStreetMap for geocoding and for searching the database. Search library."
|
description = "A tool for building a database of OpenStreetMap for geocoding and for searching the database. Search library."
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
requires-python = ">=3.7"
|
requires-python = ">=3.9"
|
||||||
license = 'GPL-3.0-or-later'
|
license = 'GPL-3.0-or-later'
|
||||||
maintainers = [
|
maintainers = [
|
||||||
{ name = "Sarah Hoffmann", email = "lonvia@denofr.de" },
|
{ name = "Sarah Hoffmann", email = "lonvia@denofr.de" },
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
name = "nominatim-db"
|
name = "nominatim-db"
|
||||||
description = "A tool for building a database of OpenStreetMap for geocoding and for searching the database. Database backend."
|
description = "A tool for building a database of OpenStreetMap for geocoding and for searching the database. Database backend."
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
requires-python = ">=3.7"
|
requires-python = ">=3.9"
|
||||||
license = 'GPL-3.0-or-later'
|
license = 'GPL-3.0-or-later'
|
||||||
maintainers = [
|
maintainers = [
|
||||||
{ name = "Sarah Hoffmann", email = "lonvia@denofr.de" },
|
{ name = "Sarah Hoffmann", email = "lonvia@denofr.de" },
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# This file is part of Nominatim. (https://nominatim.org)
|
# 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.
|
# For a full list of authors see the git log.
|
||||||
"""
|
"""
|
||||||
Functions for specialised logging with HTML output.
|
Functions for specialised logging with HTML output.
|
||||||
@@ -106,9 +106,6 @@ class BaseLogger:
|
|||||||
except TypeError:
|
except TypeError:
|
||||||
return sqlstr
|
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)
|
sqlstr = re.sub(r'__\[POSTCOMPILE_([^]]*)\]', r'%(\1)s', sqlstr)
|
||||||
return sqlstr % params
|
return sqlstr % params
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user