Skip to content

Commit

Permalink
Re-introduce python 3.8 support
Browse files Browse the repository at this point in the history
Close #33
  • Loading branch information
agrenott committed Nov 19, 2023
1 parent 14daf44 commit 224884e
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pythonpackage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion pyhgtmap/hgt/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

Expand Down
2 changes: 1 addition & 1 deletion pyhgtmap/output/pbfUtil.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions pyhgtmap/sources/sonny.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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",
}
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/hgt/test_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 224884e

Please sign in to comment.