Skip to content

Commit

Permalink
ci: Check mypy on pre-commit instead of workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmckinney committed Oct 16, 2024
1 parent cc4d8ca commit 301f31e
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 17 deletions.
15 changes: 0 additions & 15 deletions .github/workflows/mypy.yml

This file was deleted.

11 changes: 11 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,14 @@ repos:
hooks:
- id: ruff
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.12.0
hooks:
- id: mypy
# "In Python 3.11 and newer, the class syntax supports generic named tuple classes."
# https://typing.readthedocs.io/en/latest/spec/namedtuples.html
language_version: "3.11"
exclude: "(docs|tests)/"
additional_dependencies:
- types-orjson
- types-pika
7 changes: 6 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,9 @@ ignore-variadic-names = true
"ARG001", "D", "FBT003", "INP001", "PLR2004", "S", "TRY003",
]
"tests/fixtures/*" = ["T201"] # print
"yapw/clients.py" = ["ARG002"] # pika
"yapw/clients.py" = ["ARG002"] # pika

[tool.mypy]
strict = true
warn_unreachable = true
exclude = "(build|docs|tests)/"
2 changes: 1 addition & 1 deletion yapw/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class State(NamedTuple, Generic[T]):

else:

class State(NamedTuple):
class State(NamedTuple): # "TypeError: Multiple inheritance with NamedTuple is not supported"
"""Attributes that can be used safely in consumer callbacks."""

#: A function to format the routing key.
Expand Down

0 comments on commit 301f31e

Please sign in to comment.