Skip to content

Commit b8157db

Browse files
Merge pull request #194 from developmentseed/patch/fix-type-hints
update type hints
2 parents db66da8 + 4861767 commit b8157db

File tree

5 files changed

+71
-63
lines changed

5 files changed

+71
-63
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ jobs:
3434
if: ${{ matrix.python-version == env.LATEST_PY_VERSION }}
3535
run: |
3636
uv run pre-commit run --all-files
37+
uv run --with mypy mypy -p morecantile --ignore-missing-imports
3738
3839
- name: Run tests
3940
run: uv run pytest --cov morecantile --cov-report term-missing --cov-report xml

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
## 7.0.1 (2025-12-19)
55

6+
* fix and improve type hints
67
* remove `bump-my-version` from dev dependencies
78

89
## 7.0.0 (2025-11-20)

morecantile/defaults.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import os
44
import pathlib
55
from copy import copy, deepcopy
6-
from typing import Dict, List, Union
76

87
import attr
98

@@ -17,7 +16,7 @@
1716
if user_tms_dir:
1817
tms_paths.extend(list(pathlib.Path(user_tms_dir).glob("*.json")))
1918

20-
default_tms: Dict[str, Union[TileMatrixSet, pathlib.Path]] = {
19+
default_tms: dict[str, TileMatrixSet | pathlib.Path] = {
2120
tms.stem: tms for tms in sorted(tms_paths)
2221
}
2322

@@ -26,7 +25,7 @@
2625
class TileMatrixSets:
2726
"""Default TileMatrixSets holder."""
2827

29-
tilematrixsets: Dict = attr.ib()
28+
tilematrixsets: dict = attr.ib()
3029

3130
def get(self, identifier: str) -> TileMatrixSet:
3231
"""Fetch a TMS."""
@@ -43,13 +42,13 @@ def get(self, identifier: str) -> TileMatrixSet:
4342

4443
return deepcopy(tilematrix)
4544

46-
def list(self) -> List[str]:
45+
def list(self) -> list[str]:
4746
"""List registered TMS."""
4847
return list(self.tilematrixsets.keys())
4948

5049
def register(
5150
self,
52-
custom_tms: Dict[str, TileMatrixSet],
51+
custom_tms: dict[str, TileMatrixSet],
5352
overwrite: bool = False,
5453
) -> "TileMatrixSets":
5554
"""Register TileMatrixSet(s)."""

0 commit comments

Comments
 (0)