Skip to content

Commit

Permalink
Run mypy in strict mode
Browse files Browse the repository at this point in the history
  • Loading branch information
rec committed Jan 25, 2024
1 parent 7f6cdcd commit 3264706
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ line-length = 88

[tool.ruff.format]
quote-style = "single"

[tool.mypy]
strict = true
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
8 changes: 4 additions & 4 deletions tdir/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ def tdir(
"""
td: _Tdir

@dek.dek(methods=methods)
def call(func, *args, **kwargs) -> None:
@dek.dek(methods=methods) # type: ignore[misc]
def call(func: t.Callable[..., None], *args: t.Any, **kwargs: t.Any) -> None:
with td:
func(*args, **kwargs)

Expand All @@ -183,7 +183,7 @@ def call(func, *args, **kwargs) -> None:
@dc.dataclass
class _Tdir:
args: t.Sequence[Arg]
call: t.Callable
call: t.Callable[..., '_Tdir']
chdir: bool
clear: bool
kwargs: t.Dict[str, Arg]
Expand Down Expand Up @@ -232,7 +232,7 @@ def __exit__(
elif not self.use_dir:
self._td.__exit__(exc_type, exc_val, exc_tb)

def __call__(self, *args, **kwargs) -> t.Any:
def __call__(self, *args: t.Any, **kwargs: t.Any) -> _Tdir:
return self.call(*args, **kwargs)


Expand Down

0 comments on commit 3264706

Please sign in to comment.