Skip to content

Commit

Permalink
Try to fix mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
aarchiba committed Feb 27, 2024
1 parent 8df8971 commit c920ce7
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 71 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ jobs:
tox_env: 'black'
- os: ubuntu-latest
python: '3.12'
tox_env: 'py312-test-cov'
tox_env: 'mypy'
- os: ubuntu-latest
python: '3.12'
tox_env: 'notebooks'
tox_env: 'py312-test-cov'
- os: ubuntu-latest
python: '3.12'
tox_env: 'mypy'
tox_env: 'notebooks'
# - os: ubuntu-latest
# python: '3.8'
# tox_env: 'docs'
Expand Down
64 changes: 64 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@

[mypy]
warn_unused_configs = True
files = src/pint

[mypy-pint.templates.*]
ignore_errors = True

[mypy-pint.derived_quantities]
ignore_errors = True

[mypy-pint.observatory.*]
ignore_errors = True

[mypy-pint.models.stand_alone_psr_binaries.*]
ignore_errors = True

[mypy-pint.models.timing_model]
ignore_errors = True

[mypy-pint.models.pulsar_binary]
ignore_errors = True

[mypy-pint.fitter]
ignore_errors = True

[mypy-pint.polycos]
ignore_errors = True

[mypy-pint.output.publish]
ignore_errors = True

[mypy-pint.gridutils]
ignore_errors = True

[mypy-pint.scripts.*]
ignore_errors = True

[mypy-pint.pintk.plk]
ignore_errors = True

[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
64 changes: 0 additions & 64 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -129,67 +129,3 @@ skip_glob =
src/pint/extern/*
include_trailing_comma = True
combine_as_imports = True

[mypy]
warn_unused_configs = True
files = src/pint

[mypy-pint.templates.*]
ignore_errors = True

[mypy-pint.derived_quantities]
ignore_errors = True

[mypy-pint.observatory.*]
ignore_errors = True

[mypy-pint.models.stand_alone_psr_binaries.*]
ignore_errors = True

[mypy-pint.models.timing_model]
ignore_errors = True

[mypy-pint.models.pulsar_binary]
ignore_errors = True

[mypy-pint.fitter]
ignore_errors = True

[mypy-pint.polycos]
ignore_errors = True

[mypy-pint.output.publish]
ignore_errors = True

[mypy-pint.gridutils]
ignore_errors = True

[mypy-pint.scripts.*]
ignore_errors = True

[mypy-pint.pintk.plk]
ignore_errors = True

[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
5 changes: 3 additions & 2 deletions src/pint/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,10 @@
import re
import sys
import warnings
from loguru import logger as log
from typing import Dict

from erfa import ErfaWarning
from loguru import logger as log

__all__ = ["LogFilter", "setup", "format", "levels", "get_level"]

Expand All @@ -72,7 +73,7 @@
# https://loguru.readthedocs.io/en/stable/api/logger.html#color

showwarning_ = warnings.showwarning
warning_onceregistry: dict[tuple[str, str], int] = {}
warning_onceregistry: Dict[tuple[str, str], int] = {}

# basic loguru level definitions from:
# https://loguru.readthedocs.io/en/stable/api/logger.html
Expand Down
5 changes: 3 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,10 @@ commands = sphinx-build -d "{toxworkdir}/docs_doctree" . "{toxworkdir}/docs_out"
skip_install = true
changedir = .
description = use black
basepython = python3.12
deps =
black~=23.0
commands = black --check src tests examples
commands = black src tests examples {posargs:--check}


[testenv:mypy]
Expand All @@ -146,4 +147,4 @@ deps =
GitPython
types-setuptools
types-tqdm
commands = mypy
commands = mypy --no-incremental {posargs}

0 comments on commit c920ce7

Please sign in to comment.