Skip to content

Commit

Permalink
chore: remove numpy from deps, add mypy, add pandas 2.2 to free-threa…
Browse files Browse the repository at this point in the history
…d test, use local mypy in pre-commit, add stubtest
  • Loading branch information
dimastbk committed Nov 16, 2024
1 parent 6e227c2 commit e7df8df
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 16 deletions.
9 changes: 2 additions & 7 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -128,11 +127,7 @@ jobs:
py
${{ env.pythonLocation }}
- run: pip install pre-commit
if: steps.cache-py.outputs.cache-hit != 'true'

- run: pip install .
if: steps.cache-py.outputs.cache-hit != 'true'
- run: pip install .[dev]

- run: pip freeze

Expand Down
15 changes: 10 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ 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",
]

[tool.isort]
Expand All @@ -31,6 +31,7 @@ multi_line_output = 3
profile = "black"

[tool.mypy]
files = ["python"]
python_version = "3.8"
ignore_missing_imports = false
disallow_untyped_defs = true
Expand Down
8 changes: 6 additions & 2 deletions python/python_calamine/pandas.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit e7df8df

Please sign in to comment.