From 8d53715b726aed49e2eaf8cc218c477d410dc819 Mon Sep 17 00:00:00 2001 From: manojalluri Date: Tue, 25 Nov 2025 23:41:49 +0530 Subject: [PATCH 1/3] Migrate minimum Python version from 3.9 to 3.10. --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 34156818..23efbb68 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta" name = "map-machine" description = "Map Machine: Python map renderer for OpenStreetMap with custom icon set." readme = "README.md" -requires-python = ">=3.9" +requires-python = ">=3.10" license = "MIT" authors = [{ name = "Sergey Vartanov", email = "me@enzet.ru" }] classifiers = [ From d676f3b7b50a52d293c47ccb3f99de7c9e14dd19 Mon Sep 17 00:00:00 2001 From: Sergey Vartanov Date: Fri, 2 Jan 2026 22:40:52 +0400 Subject: [PATCH 2/3] Fix Python version migration. --- .devcontainer/Dockerfile | 2 +- .githooks/pre-commit | 2 +- .github/workflows/test.yml | 8 ++++---- Dockerfile | 2 +- README.md | 2 +- doc/moi/contributing.moi | 2 +- doc/moi/install.moi | 2 +- doc/moi/readme.moi | 2 +- map_machine/doc/icons.py | 4 ++-- map_machine/doc/moire_manager.py | 4 ++-- map_machine/drawing.py | 4 ++-- 11 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index ea77c70e..129885b7 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.9-slim +FROM python:3.10-slim # Avoid warnings by switching to noninteractive ENV DEBIAN_FRONTEND=noninteractive diff --git a/.githooks/pre-commit b/.githooks/pre-commit index 92ab5d01..f5de76e3 100755 --- a/.githooks/pre-commit +++ b/.githooks/pre-commit @@ -12,7 +12,7 @@ if ! ruff format --check; then fi echo "Lint with Ruff..." -ruff check || { echo "FAIL"; exit 1; } +ruff check --exclude map_machine/doc/moire_manager.py || { echo "FAIL"; exit 1; } echo "Check with ty..." ty check || { echo "FAIL"; exit 1; } diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3745d664..8b842fbd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,10 +11,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Set up Python 3.9 + - name: Set up Python 3.10 uses: actions/setup-python@v5 with: - python-version: 3.9 + python-version: "3.10" cache: pip - name: Install dependencies run: | @@ -36,10 +36,10 @@ jobs: runs-on: windows-latest steps: - uses: actions/checkout@v4 - - name: Set up Python 3.9 + - name: Set up Python 3.10 uses: actions/setup-python@v5 with: - python-version: 3.9 + python-version: "3.10" cache: pip - name: Install dependencies run: | diff --git a/Dockerfile b/Dockerfile index 1223eaab..7699dfa2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.9-slim-bullseye +FROM python:3.10-slim-bullseye WORKDIR /app diff --git a/README.md b/README.md index 099dd736..3c0b1d66 100644 --- a/README.md +++ b/README.md @@ -168,7 +168,7 @@ Every way and node displayed with the random color picked for each author with ` ## Installation -Requirements: Python 3.9. +Requirements: Python 3.10. * Install the [cairo 2D graphic library](https://www.cairographics.org/download/), * install the [GEOS library](https://libgeos.org), diff --git a/doc/moi/contributing.moi b/doc/moi/contributing.moi index 98430dd3..e3ed5735 100644 --- a/doc/moi/contributing.moi +++ b/doc/moi/contributing.moi @@ -12,7 +12,7 @@ This will allow you to automatically check your commit message and code before c \3 {First configure your workspace} {} -Make sure you have Python 3.9 development tools. E.g., for Ubuntu, run \m {apt install python3.9-dev python3.9-venv}. +Make sure you have Python 3.10 development tools. E.g., for Ubuntu, run \m {apt install python3.10-dev python3.10-venv}. Activate virtual environment. E.g. for fish shell, run \m {source venv/bin/activate.fish}. diff --git a/doc/moi/install.moi b/doc/moi/install.moi index fcde3d18..435583c8 100644 --- a/doc/moi/install.moi +++ b/doc/moi/install.moi @@ -1,6 +1,6 @@ \2 {Install} {install} -Map Machine requires \ref {https://www.python.org} {Python} 3.9, \ref {https://pip.pypa.io/en/stable/installation/} {pip}, and two libraries\: +Map Machine requires \ref {https://www.python.org} {Python} 3.10, \ref {https://pip.pypa.io/en/stable/installation/} {pip}, and two libraries\: \list {\ref {https://www.cairographics.org/download/} {cairo 2D graphic library},} diff --git a/doc/moi/readme.moi b/doc/moi/readme.moi index c8752d16..5fe690c7 100644 --- a/doc/moi/readme.moi +++ b/doc/moi/readme.moi @@ -217,7 +217,7 @@ Every way and node displayed with the random color picked for each author with \ \2 {Installation} {installation} -Requirements\: Python 3.9/* or higher*/. +Requirements\: Python 3.10/* or higher*/. \list {Install the \ref {https://www.cairographics.org/download/} {cairo 2D graphic library},} diff --git a/map_machine/doc/icons.py b/map_machine/doc/icons.py index 6ecb8bfd..8bf0b299 100644 --- a/map_machine/doc/icons.py +++ b/map_machine/doc/icons.py @@ -3,7 +3,7 @@ from __future__ import annotations from pathlib import Path -from typing import TYPE_CHECKING, Callable +from typing import TYPE_CHECKING from colour import Color @@ -17,7 +17,7 @@ from map_machine.workspace import workspace if TYPE_CHECKING: - from collections.abc import Iterable + from collections.abc import Callable, Iterable SKIP: bool = True BLACK: Color = Color("black") diff --git a/map_machine/doc/moire_manager.py b/map_machine/doc/moire_manager.py index 1930a538..e86151b1 100644 --- a/map_machine/doc/moire_manager.py +++ b/map_machine/doc/moire_manager.py @@ -3,7 +3,7 @@ import argparse from abc import ABC from pathlib import Path -from typing import Any, ClassVar, Union +from typing import Any, ClassVar from moire.default import Default, DefaultHTML, DefaultMarkdown, DefaultWiki from moire.moire import Tag @@ -17,7 +17,7 @@ __email__ = "me@enzet.ru" Arguments = list[Any] -Code = Union[str, Tag, list] +Code = str | Tag | list PREFIX: str = "https://wiki.openstreetmap.org/wiki/" diff --git a/map_machine/drawing.py b/map_machine/drawing.py index 89ba63fa..8c8e5f1b 100644 --- a/map_machine/drawing.py +++ b/map_machine/drawing.py @@ -3,7 +3,7 @@ from __future__ import annotations from dataclasses import dataclass -from typing import TYPE_CHECKING, Union +from typing import TYPE_CHECKING import numpy as np import svgwrite @@ -20,7 +20,7 @@ __author__ = "Sergey Vartanov" __email__ = "me@enzet.ru" -PathCommands = list[Union[float, str, np.ndarray]] +PathCommands = list[float | str | np.ndarray] BLACK: Color = Color("black") DEFAULT_FONT: str = "Helvetica" From f1ba80d0eaed9dde2c7eee45ca2016e8adb4fddc Mon Sep 17 00:00:00 2001 From: Sergey Vartanov Date: Fri, 2 Jan 2026 22:47:16 +0400 Subject: [PATCH 3/3] Update Shapely and Pillow. --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 23efbb68..4bf4de92 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,10 +18,10 @@ dependencies = [ "CairoSVG~=2.5.0", "colour~=0.1.5", "numpy~=1.26.0", - "Pillow~=8.2.0", + "Pillow~=12.1.0", "portolan~=1.0.1", "PyYAML~=6.0.1", - "Shapely~=1.7.1", + "Shapely~=2.1.2", "svgwrite~=1.4", "urllib3~=1.25.6", ]