diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 0271642..6d88d2f 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -36,9 +36,8 @@ jobs: pandas-version: "none" - python-version: "3.13" pandas-version: "2.2.*" - # https://github.com/pandas-dev/pandas/issues/60016 - python-version: "3.13" - pandas-version: "none" + pandas-version: "2.2.*" disable-gil: true runs-on: ubuntu-latest @@ -128,10 +127,7 @@ jobs: py ${{ env.pythonLocation }} - - run: pip install pre-commit - if: steps.cache-py.outputs.cache-hit != 'true' - - - run: pip install . + - run: pip install .[dev] if: steps.cache-py.outputs.cache-hit != 'true' - run: pip freeze diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6496ca5..a235b51 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -34,13 +34,18 @@ repos: rev: 24.1.1 hooks: - id: black - - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.8.0 + - repo: local hooks: - id: mypy - additional_dependencies: - - pandas-stubs - exclude: ^tests/.*$ + name: mypy + entry: mypy + language: python + pass_filenames: false + - id: mypy-stubtest + name: stubtest python_calamine + entry: mypy + language: python + pass_filenames: false - repo: local hooks: - id: rust-linting diff --git a/pyproject.toml b/pyproject.toml index 58a05d8..b0436ce 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,9 +19,10 @@ dynamic = ["version"] dev = [ "maturin~=1.0", "pre-commit~=3.0", + "mypy~=1.13", "pytest~=8.0", - "pandas[excel]~=2.0", - "numpy~=1.0", + "pandas[excel]~=2.2", + "pandas-stubs~=2.2", ] [tool.isort] @@ -31,6 +32,7 @@ multi_line_output = 3 profile = "black" [tool.mypy] +files = ["python"] python_version = "3.8" ignore_missing_imports = false disallow_untyped_defs = true diff --git a/python/python_calamine/pandas.py b/python/python_calamine/pandas.py index a547ae3..c6c9611 100644 --- a/python/python_calamine/pandas.py +++ b/python/python_calamine/pandas.py @@ -7,8 +7,12 @@ import pandas as pd from packaging.version import Version, parse from pandas._typing import Scalar -from pandas.compat._optional import import_optional_dependency -from pandas.core.shared_docs import _shared_docs +from pandas.compat._optional import ( # type:ignore[import-untyped] # missing in pandas-stubs + import_optional_dependency, +) +from pandas.core.shared_docs import ( # type:ignore[import-untyped] # missing in pandas-stubs + _shared_docs, +) from pandas.io.excel import ExcelFile from pandas.io.excel._base import ( # type:ignore[attr-defined] # missing in pandas-stubs BaseExcelReader,