Skip to content

Commit

Permalink
fix up pre-commit by dropping 3.9 check for mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
kratsg committed Dec 21, 2024
1 parent ae22f81 commit 6bd0d3b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
5 changes: 3 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,15 @@ repos:
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.13.0
# check the oldest and newest supported Pythons
# except skip python 3.9 for numpy, due to poor typing
hooks:
- &mypy
id: mypy
name: mypy with Python 3.9
name: mypy with Python 3.10
files: src
additional_dependencies:
['numpy', 'types-tqdm', 'click', 'types-jsonpatch', 'types-pyyaml', 'types-jsonschema', 'importlib_metadata', 'packaging']
args: ["--python-version=3.9"]
args: ["--python-version=3.10"]
- <<: *mypy
name: mypy with Python 3.12
args: ["--python-version=3.12"]
Expand Down
3 changes: 1 addition & 2 deletions src/pyhf/tensor/numpy_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,7 @@ def tolist(
self, tensor_in: Tensor[T] | list[T]
) -> int | float | complex | list[T] | list[Any]:
try:
# unused-ignore for [no-any-return] in python 3.9
return tensor_in.tolist() # type: ignore[union-attr,no-any-return,unused-ignore]
return tensor_in.tolist() # type: ignore[union-attr]
except AttributeError:
if isinstance(tensor_in, list):
return tensor_in
Expand Down

0 comments on commit 6bd0d3b

Please sign in to comment.