Skip to content

Commit

Permalink
Enable mypy linting
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen Finucane <stephen@that.guru>
  • Loading branch information
stephenfin committed Jul 2, 2024
1 parent 8f65b12 commit 2b60be7
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
11 changes: 11 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,14 @@ repos:
- id: ruff
args: [ --fix ]
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.10.1
hooks:
- id: mypy
exclude: |
(?x)(
tests/.*
| docs/.*
)
additional_dependencies:
- "types-setuptools"
2 changes: 1 addition & 1 deletion src/wrapt/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,4 +512,4 @@ def __exit__(self, *args):
return _FinalDecorator(wrapped=wrapped, wrapper=_synchronized_wrapper)


synchronized._synchronized_meta_lock = Lock()
setattr(synchronized, '_synchronized_meta_lock', Lock())
3 changes: 2 additions & 1 deletion src/wrapt/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from importlib.util import find_spec
import sys
import threading
from typing import Callable

from .__wrapt__ import ObjectProxy

Expand All @@ -15,7 +16,7 @@
# module will be truncated but the list left in the dictionary. This
# acts as a flag to indicate that the module had already been imported.

_post_import_hooks = {}
_post_import_hooks: dict[str, list[Callable[[object], object]]] = {}
_post_import_hooks_init = False
_post_import_hooks_lock = threading.RLock()

Expand Down
2 changes: 1 addition & 1 deletion src/wrapt/wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ def __imod__(self, other):
self.__wrapped__ %= other
return self

def __ipow__(self, other):
def __ipow__(self, other, *args):
self.__wrapped__ **= other
return self

Expand Down

0 comments on commit 2b60be7

Please sign in to comment.