diff --git a/.github/workflows/pythonpackage.yaml b/.github/workflows/pythonpackage.yaml index 4433945..c1a1846 100644 --- a/.github/workflows/pythonpackage.yaml +++ b/.github/workflows/pythonpackage.yaml @@ -12,7 +12,7 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: ["3.9", "3.10", "3.11", "3.12"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] platform: [ubuntu-latest, macos-latest] #, windows-latest] runs-on: ${{ matrix.platform }} diff --git a/README.md b/README.md index 8a1e398..d9c4cbc 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Python: 3.9, 3.10, 3.11, 3.12](https://img.shields.io/badge/python-3.9%20%7C%203.10%20%7C%203.11%20%7C%203.12-blue)](https://www.python.org) +[![Python: 3.8, 3.9, 3.10, 3.11, 3.12](https://img.shields.io/badge/python-3.8%20%7C%203.9%20%7C%203.10%20%7C%203.11%20%7C%203.12-blue)](https://www.python.org) ![GitHub](https://img.shields.io/github/license/agrenott/pyhgtmap) ![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/agrenott/pyhgtmap/pythonpackage.yaml) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) diff --git a/pyhgtmap/hgt/file.py b/pyhgtmap/hgt/file.py index d28f349..0dc9c94 100644 --- a/pyhgtmap/hgt/file.py +++ b/pyhgtmap/hgt/file.py @@ -244,7 +244,7 @@ def polygon_mask( which is the projection used within polygon files. """ X, Y = numpy.meshgrid(x_data, y_data) - xyPoints: Iterable[tuple[float, float]] = numpy.vstack(([X.T], [Y.T])).T.reshape( + xyPoints: Iterable[Tuple[float, float]] = numpy.vstack(([X.T], [Y.T])).T.reshape( len(x_data) * len(y_data), 2 ) diff --git a/pyhgtmap/output/pbfUtil.py b/pyhgtmap/output/pbfUtil.py index 8bad03f..111b8f1 100644 --- a/pyhgtmap/output/pbfUtil.py +++ b/pyhgtmap/output/pbfUtil.py @@ -76,7 +76,7 @@ def _write_ways(self, ways: pyhgtmap.output.WaysType, startWayId) -> None: The waylist is split up to make sure the pbf blobs will not be too big. """ for ind, way in enumerate(ways): - closed_loop_id: list[int] = ( + closed_loop_id: List[int] = ( [way["first_node_id"]] if way["closed_loop"] else [] ) osm_way = npyosmium.osm.mutable.Way( diff --git a/pyhgtmap/sources/sonny.py b/pyhgtmap/sources/sonny.py index 67a2da9..697e612 100644 --- a/pyhgtmap/sources/sonny.py +++ b/pyhgtmap/sources/sonny.py @@ -1,7 +1,7 @@ import io import os import pathlib -from typing import List, Optional, cast +from typing import Dict, List, Optional, cast from zipfile import ZipFile from pydrive2.auth import GoogleAuth @@ -22,7 +22,7 @@ class Sonny(Source): # Root Sonny's Google Drive folders IDs for Europe DTMs, for various resolutions # TODO: does this change often? Should it be configurable/self-discovered from website? - FOLDER_IDS: dict[int, str] = { + FOLDER_IDS: Dict[int, str] = { 1: "0BxphPoRgwhnoWkRoTFhMbTM3RDA", 3: "0BxphPoRgwhnoekRQZUZJT2ZRX2M", } diff --git a/pyproject.toml b/pyproject.toml index c5dceee..e6daef1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,7 +38,7 @@ keywords = ["osm", "OpenStreetMap", "countour", "SRTM", "elevation"] license = "GPL-2.0-or-later" name = "pyhgtmap" readme = "README.md" -requires-python = ">=3.9" +requires-python = ">=3.8" [project.optional-dependencies] geotiff = [ @@ -92,7 +92,7 @@ test_cov = [ typing = "mypy {args}" [[tool.hatch.envs.test.matrix]] -python = ["3.9", "3.10", "3.11", "3.12"] +python = ["3.8", "3.9", "3.10", "3.11", "3.12"] [tool.hatch.envs.geotiff] # Env for optional geotiff dependencies diff --git a/tests/hgt/test_processor.py b/tests/hgt/test_processor.py index 9616956..b1b8089 100644 --- a/tests/hgt/test_processor.py +++ b/tests/hgt/test_processor.py @@ -182,7 +182,7 @@ def _test_process_files(nb_jobs: int, options) -> None: # Instrument method without changing its behavior processor.process_tile_internal = Mock(side_effect=processor.process_tile_internal) # type: ignore processor.process_files(files_list) - out_files_names: list[str] = sorted(glob.glob("*.osm.pbf")) + out_files_names: List[str] = sorted(glob.glob("*.osm.pbf")) # We may have more files generated (eg. .coverage ones) assert out_files_names == [ "lon6.00_7.00lat43.00_43.50_local-source.osm.pbf", @@ -253,7 +253,7 @@ def _test_process_files_single_output(nb_jobs: int, options) -> None: # Instrument method without changing its behavior processor.process_tile_internal = Mock(side_effect=processor.process_tile_internal) # type: ignore processor.process_files(files_list) - out_files_names: list[str] = sorted(glob.glob("*.osm.pbf")) + out_files_names: List[str] = sorted(glob.glob("*.osm.pbf")) # We may have more files generated (eg. .coverage ones) assert out_files_names == [ "lon6.00_8.00lat43.00_44.00_local-source.osm.pbf",