Skip to content

Commit

Permalink
Merge pull request #1355 from DimitriPapadopoulos/PYI
Browse files Browse the repository at this point in the history
STY: Enforce ruff/flake8-pyi rules (PYI)
  • Loading branch information
effigies authored Sep 23, 2024
2 parents ddec715 + df862cc commit 8c962e2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion nibabel/openers.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from types import TracebackType

from _typeshed import WriteableBuffer
from typing_extensions import Self

ModeRT = ty.Literal['r', 'rt']
ModeRB = ty.Literal['rb']
Expand Down Expand Up @@ -246,7 +247,7 @@ def close_if_mine(self) -> None:
if self.me_opened:
self.close()

def __enter__(self) -> Opener:
def __enter__(self) -> Self:
return self

def __exit__(
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ select = [
"I",
"PIE",
"PLE",
"PYI",
"Q",
"RSE",
"TCH",
Expand All @@ -143,6 +144,7 @@ ignore = [
"C408",
"C416",
"PIE790",
"PYI024",
# https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
"W191",
"E111",
Expand Down
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ deps =
numpy
pyzstd
importlib_resources
typing_extensions
skip_install = true
commands =
mypy nibabel
Expand Down

0 comments on commit 8c962e2

Please sign in to comment.