Skip to content
Snippets Groups Projects
Commit ce167433 authored by Max Drexler's avatar Max Drexler
Browse files

mypy configuration

parent 9294f4f4
No related branches found
No related tags found
No related merge requests found
Pipeline #53709 failed
...@@ -11,4 +11,4 @@ from grib_processor.main import main ...@@ -11,4 +11,4 @@ from grib_processor.main import main
if __name__ == "__main__": if __name__ == "__main__":
sys.exit(main()) sys.exit(main()) # type: ignore[func-returns-value]
...@@ -15,7 +15,7 @@ from typing import Generator ...@@ -15,7 +15,7 @@ from typing import Generator
import grib2io import grib2io
from ssec_amqp import utils as amqp_utils from ssec_amqp import utils as amqp_utils
from typing_extensions import Literal, TypedDict from typing_extensions import Literal, TypedDict, TypeAlias
from grib_processor import data from grib_processor import data
...@@ -25,6 +25,9 @@ if sys.version_info < (3, 9): ...@@ -25,6 +25,9 @@ if sys.version_info < (3, 9):
else: else:
import importlib.resources as resources import importlib.resources as resources
# Custom types
IsoStr: TypeAlias = str
# Contains a serializable mapping of first_lat, first_lon, rows, cols, # Contains a serializable mapping of first_lat, first_lon, rows, cols,
# and generating_process_ids to xcd model names and ids. # and generating_process_ids to xcd model names and ids.
# #
...@@ -55,8 +58,8 @@ class GribMetadata(TypedDict): ...@@ -55,8 +58,8 @@ class GribMetadata(TypedDict):
last_lon: float | None last_lon: float | None
forecast_hour: int forecast_hour: int
run_hour: int run_hour: int
model_time: datetime model_time: IsoStr
start_time: datetime start_time: IsoStr
projection: str projection: str
center_id: int center_id: int
center_desc: str center_desc: str
...@@ -82,7 +85,7 @@ class GribPayload(GribMetadata): ...@@ -82,7 +85,7 @@ class GribPayload(GribMetadata):
the file and server itself. the file and server itself.
""" """
__payload_gen_time__: datetime __payload_gen_time__: IsoStr
__injector_script__: str __injector_script__: str
path: str path: str
directory: str directory: str
......
...@@ -35,3 +35,10 @@ packages = ["grib_processor"] ...@@ -35,3 +35,10 @@ packages = ["grib_processor"]
[tool.setuptools.dynamic] [tool.setuptools.dynamic]
version = {attr = "grib_processor.__version__"} version = {attr = "grib_processor.__version__"}
[tool.mypy]
python_version = "3.8"
disable_error_code = [
"import-untyped",
]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment