-
Notifications
You must be signed in to change notification settings - Fork 258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
STY: Enforce ruff/flake8-pyi rules (PYI) #1355
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1355 +/- ##
=======================================
Coverage 95.34% 95.34%
=======================================
Files 207 207
Lines 29494 29494
Branches 4978 4978
=======================================
Hits 28122 28122
Misses 932 932
Partials 440 440 ☔ View full report in Codecov by Sentry. |
@@ -22,6 +22,7 @@ | |||
from types import TracebackType | |||
|
|||
from _typeshed import WriteableBuffer | |||
from typing_extensions import Self |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to add this to dependencies. Should guard and import from typing for Python <3.11, and then we can use typing_extensions >=VER; python_version < '3.11'
.
Ah, I see, it's in ty.TYPE_CHECKING
guard. We should add to tox:
Lines 172 to 186 in d1930e9
[testenv:typecheck] | |
description = Check type consistency | |
labels = check | |
deps = | |
mypy | |
pytest | |
types-setuptools | |
types-Pillow | |
pydicom | |
numpy | |
pyzstd | |
importlib_resources | |
skip_install = true | |
commands = | |
mypy nibabel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add typing_extensions
.
93b272d
to
f56bcff
Compare
f56bcff
to
cd9022c
Compare
PYI034 `__enter__` methods usually return `self` at runtime
cd9022c
to
df862cc
Compare
No description provided.