Skip to content

Commit

Permalink
Merge pull request #89 from ikalnytskyi/chore/mypy
Browse files Browse the repository at this point in the history
Add the MyPy type checker
  • Loading branch information
ikalnytskyi authored Feb 10, 2024
2 parents e113034 + 3982a4f commit d203943
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,20 @@ jobs:
- name: Run pytest
run: pipx run -- hatch run test:run

type:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.12"

- name: Run lints
run: pipx run -- hatch run type:run

docs:
runs-on: ubuntu-latest
steps:
Expand Down
22 changes: 22 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ detached = true
dependencies = ["ruff == 0.2.*"]
scripts.run = ["ruff check {args:.}", "ruff format --check --diff {args:.}"]

[tool.hatch.envs.type]
dependencies = ["mypy"]
scripts.run = ["mypy {args}"]

[tool.hatch.envs.docs]
pre-install-commands = ["python -m pip install -r docs/requirements.txt"]
scripts.run = "sphinx-build -W -b html docs docs/_build/"
Expand Down Expand Up @@ -84,3 +88,21 @@ known-first-party = ["picobox"]
[tool.ruff.lint.per-file-ignores]
"examples/*" = ["I", "D", "T20"]
"tests/*" = ["D"]

[tool.mypy]
python_version = "3.8"
files = ["src"]
pretty = true
strict = true
disable_error_code = [
"assignment",
"attr-defined",
"comparison-overlap",
"import-not-found",
"misc",
"no-any-return",
"no-untyped-call",
"no-untyped-def",
"type-arg",
"var-annotated",
]

0 comments on commit d203943

Please sign in to comment.