Mypy type checking (#119)
* Update Makefile * Update changelog * gitignore mypy cache * mypy config * Add color to mypy output Co-authored-by: Antonin Raffin <antonin.raffin@ensta.org>
This commit is contained in:
parent
703fd2dd68
commit
3d28d1e5de
|
|
@ -11,6 +11,9 @@ on:
|
|||
|
||||
jobs:
|
||||
build:
|
||||
env:
|
||||
TERM: xterm-256color
|
||||
FORCE_COLOR: 1
|
||||
# Skip CI if [ci skip] in the commit message
|
||||
if: "! contains(toJSON(github.event.commits.*.message), '[ci skip]')"
|
||||
runs-on: ubuntu-latest
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ _build/
|
|||
*.npz
|
||||
*.pth
|
||||
.pytype/
|
||||
.mypy_cache
|
||||
git_rewrite_commit_history.sh
|
||||
|
||||
# Setuptools distribution and build folders.
|
||||
|
|
|
|||
7
Makefile
7
Makefile
|
|
@ -4,9 +4,14 @@ LINT_PATHS=sb3_contrib/ tests/ setup.py
|
|||
pytest:
|
||||
./scripts/run_tests.sh
|
||||
|
||||
type:
|
||||
pytype:
|
||||
pytype -j auto
|
||||
|
||||
mypy:
|
||||
mypy ${LINT_PATHS}
|
||||
|
||||
type: pytype mypy
|
||||
|
||||
lint:
|
||||
# stop the build if there are Python syntax errors or undefined names
|
||||
# see https://lintlyci.github.io/Flake8Rules/
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ Breaking Changes:
|
|||
|
||||
New Features:
|
||||
^^^^^^^^^^^^^
|
||||
- Introduced mypy type checking
|
||||
|
||||
Bug Fixes:
|
||||
^^^^^^^^^^
|
||||
|
|
|
|||
27
setup.cfg
27
setup.cfg
|
|
@ -19,6 +19,33 @@ markers =
|
|||
[pytype]
|
||||
inputs = sb3_contrib
|
||||
|
||||
[mypy]
|
||||
ignore_missing_imports = True
|
||||
follow_imports = silent
|
||||
show_error_codes = True
|
||||
exclude = (?x)(
|
||||
sb3_contrib/ppo_recurrent/ppo_recurrent.py$
|
||||
| sb3_contrib/ars/ars.py$
|
||||
| sb3_contrib/ars/policies.py$
|
||||
| sb3_contrib/qrdqn/qrdqn.py$
|
||||
| sb3_contrib/qrdqn/policies.py$
|
||||
| sb3_contrib/common/recurrent/type_aliases.py$
|
||||
| sb3_contrib/common/recurrent/policies.py$
|
||||
| sb3_contrib/common/recurrent/buffers.py$
|
||||
| sb3_contrib/common/utils.py$
|
||||
| sb3_contrib/common/maskable/distributions.py$
|
||||
| sb3_contrib/common/maskable/callbacks.py$
|
||||
| sb3_contrib/common/maskable/policies.py$
|
||||
| sb3_contrib/common/maskable/buffers.py$
|
||||
| sb3_contrib/common/envs/invalid_actions_env.py$
|
||||
| sb3_contrib/common/vec_env/async_eval.py$
|
||||
| sb3_contrib/tqc/tqc.py$
|
||||
| sb3_contrib/tqc/policies.py$
|
||||
| sb3_contrib/trpo/trpo.py$
|
||||
| sb3_contrib/ppo_mask/ppo_mask.py$
|
||||
| tests/test_train_eval_mode.py$
|
||||
)
|
||||
|
||||
[flake8]
|
||||
# line breaks before and after binary operators
|
||||
ignore = W503,W504,E203,E231
|
||||
|
|
|
|||
Loading…
Reference in New Issue