diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 13106ee..77f0012 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,3 +10,12 @@ repos: hooks: - id: black language_version: python3 + + - repo: https://github.com/pre-commit/mirrors-mypy + rev: 'v1.18.2' + hooks: + - id: mypy + name: mypy + additional_dependencies: [types-PyYAML==6.0.12.20240808, types-python-dateutil] + + diff --git a/ci/environment-3.10.yml b/ci/environment-3.10.yml index ad16be3..403d6d4 100644 --- a/ci/environment-3.10.yml +++ b/ci/environment-3.10.yml @@ -8,6 +8,7 @@ dependencies: - intake>=0.7 - intake-esm-access - itables + - mypy - polars>=1.12 - pytest - pip diff --git a/ci/environment-3.11.yml b/ci/environment-3.11.yml index 2fb14c8..5b5ec17 100644 --- a/ci/environment-3.11.yml +++ b/ci/environment-3.11.yml @@ -8,6 +8,7 @@ dependencies: - intake>=0.7 - intake-esm-access - itables + - mypy - polars>=1.12 - pytest - pip diff --git a/ci/environment-3.12.yml b/ci/environment-3.12.yml index 6cfd0b5..d2f9c1a 100644 --- a/ci/environment-3.12.yml +++ b/ci/environment-3.12.yml @@ -8,6 +8,7 @@ dependencies: - intake>=0.7 - intake-esm-access - itables + - mypy - polars>=1.12 - pytest - pip diff --git a/ci/environment-3.13.yml b/ci/environment-3.13.yml index 016f7a2..ad93bf4 100644 --- a/ci/environment-3.13.yml +++ b/ci/environment-3.13.yml @@ -7,6 +7,7 @@ dependencies: - intake>=0.7 - intake-esm - itables + - mypy - polars>=1.12 - pytest - pip diff --git a/src/intake_dataframe_catalog/_display.py b/src/intake_dataframe_catalog/_display.py index 5ae776d..cc3e61c 100644 --- a/src/intake_dataframe_catalog/_display.py +++ b/src/intake_dataframe_catalog/_display.py @@ -49,10 +49,10 @@ def set_pd_options(self) -> None: def display_type(self) -> _DisplayType: try: # Check for Jupyter Notebook - ipy = get_ipython() + ipy = get_ipython() # type: ignore[name-defined] if hasattr(ipy, "kernel"): return _DisplayType.JUPYTER_NOTEBOOK - elif hasattr(ipy, "config"): + else: return _DisplayType.IPYTHON_REPL except NameError: return _DisplayType.REGULAR_REPL