Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mypy checking as part of CI #1725

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
4521272
Use cached_property and types
aarchiba Feb 10, 2024
32b2824
Fix python 3.8-incompatible syntax
aarchiba Feb 10, 2024
10a7248
Fill out typing more
aarchiba Feb 10, 2024
f397726
Improve attribute documentation
aarchiba Feb 10, 2024
6da627a
Additional type annotations
aarchiba Feb 21, 2024
23f5d6d
Fix list->List
aarchiba Feb 21, 2024
6fda954
dict -> Dict
aarchiba Feb 21, 2024
4893357
Initial mypy setup passing
aarchiba Feb 25, 2024
a78d8c5
Set up CI action
aarchiba Feb 25, 2024
8c0f22f
Enforce python3.12 and fix syntaxwarnings
aarchiba Feb 25, 2024
7ff5a75
Finish updating string syntax
aarchiba Feb 25, 2024
63bf866
Finish updating string syntax
aarchiba Feb 25, 2024
8df8971
Fighting with black
aarchiba Feb 25, 2024
c920ce7
Try to fix mypy
aarchiba Feb 27, 2024
3bbc6fd
Merge branch 'master' into mypy
aarchiba Feb 27, 2024
d993f41
Fix typing in simulation.py
aarchiba Feb 27, 2024
818f7cf
fix syntax for 3.8
aarchiba Feb 27, 2024
f3fe13e
Add stricter checking
aarchiba Feb 27, 2024
4086534
additional restrictions
aarchiba Feb 28, 2024
c667396
use overload to specify more closely
aarchiba Feb 28, 2024
f71cb19
Make mypy a little stricter on observatory
aarchiba Feb 28, 2024
29743b2
get timing_models passing
aarchiba Feb 28, 2024
1befd58
Get fitter working
aarchiba Feb 28, 2024
d37bd12
Get fitter working
aarchiba Feb 28, 2024
e34d35c
Cleaned up all ignore_errors
aarchiba Mar 3, 2024
843911e
Tidy derived_quantities for oldestdeps
aarchiba Mar 4, 2024
5710867
return type annotations won't work with oldestdeps
aarchiba Mar 5, 2024
da07be4
Annotating pint.utils
aarchiba Mar 5, 2024
1b3b20f
list -> List
aarchiba Mar 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ jobs:
- os: ubuntu-latest
python: '3.12'
tox_env: 'black'
- os: ubuntu-latest
python: '3.12'
tox_env: 'mypy'
- os: ubuntu-latest
python: '3.12'
tox_env: 'py312-test-cov'
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,6 @@ tests/datafile/par_*.par
tests/datafile/fake_toas.tim
tests/datafile/*.converted.par
tests/datafile/_test_pintempo.out

# mypy
.mypy_cache
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ repos:
- id: check-merge-conflict
- id: check-symlinks
- repo: https://github.com/psf/black
rev: 24.2.0
rev: 23.12.1
hooks:
- id: black
56 changes: 56 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@

[mypy]
warn_unused_configs = True
files = src/pint
# 3.8 causes a problem with some versions of matplotlib
python_version = 3.9
warn_unreachable = True
warn_return_any = True
local_partial_types = True
no_implicit_reexport = True
strict_equality = True

[mypy-pint.observatory.*]
allow_untyped_globals = True
warn_unreachable = False
warn_return_any = False

[mypy-pint.extern.*]
; external code, don't worry about it
ignore_errors = True

; Other libraries that might not have type information
; some of them seem like they should? maybe we need new versions?

[mypy-astropy.*]
ignore_missing_imports = True

[mypy-erfa]
ignore_missing_imports = True

[mypy-emcee]
ignore_missing_imports = True

[mypy-jplephem]
ignore_missing_imports = True

[mypy-numdifftools]
ignore_missing_imports = True

[mypy-pylab]
ignore_missing_imports = True

[mypy-scipy.*]
ignore_missing_imports = True

[mypy-uncertainties.*]
ignore_missing_imports = True

[mypy-fftfit]
ignore_missing_imports = True

[mypy-pathos.*]
ignore_missing_imports = True

[mypy-corner]
ignore_missing_imports = True
4 changes: 4 additions & 0 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,7 @@ loguru
gprof2dot
py-cpuinfo
pytest-xdist
mypy==1.8.0
GitPython
types-setuptools
types-tqdm
Loading
Loading