Skip to content

Commit

Permalink
Move mypy from pre-commit to tox
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Sep 9, 2024
1 parent ad031d6 commit e1d862f
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 8 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on: [push, pull_request, workflow_dispatch]

env:
FORCE_COLOR: 1
PIP_DISABLE_PIP_VERSION_CHECK: 1

permissions:
contents: read
Expand All @@ -17,4 +18,12 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: "3.x"
cache: pip
- uses: pre-commit/[email protected]

- name: Install dependencies
run: |
python3 -m pip install -U tox
- name: Mypy
run: tox -e mypy
8 changes: 0 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,6 @@ repos:
hooks:
- id: actionlint

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.11.2
hooks:
- id: mypy
additional_dependencies: [pytest, types-freezegun, types-setuptools]
args: [--strict, --pretty, --show-error-codes, .]
pass_filenames: false

- repo: https://github.com/tox-dev/pyproject-fmt
rev: 2.2.3
hooks:
Expand Down
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,8 @@ filterwarnings = [
"ignore:sys.monitoring isn't available, using default core:coverage.exceptions.CoverageWarning",
]
testpaths = [ "tests" ]

[tool.mypy]
pretty = true
strict = true
show_error_codes = true
10 changes: 10 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ requires =
env_list =
docs
lint
mypy
py{py3, 313, 312, 311, 310, 39, 38}

[testenv]
Expand Down Expand Up @@ -37,5 +38,14 @@ pass_env =
commands =
pre-commit run --all-files --show-diff-on-failure

[testenv:mypy]
deps =
mypy==1.11.2
pytest
types-freezegun
types-setuptools
commands =
mypy --strict --pretty --show-error-codes . {posargs}

[pytest]
addopts = --color=yes --doctest-modules

0 comments on commit e1d862f

Please sign in to comment.