-
Notifications
You must be signed in to change notification settings - Fork 157
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
(chore): Update to Ruff 0.9 and add EM lints #1825
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1825 +/- ##
==========================================
- Coverage 87.09% 83.64% -3.46%
==========================================
Files 40 40
Lines 6138 6267 +129
==========================================
- Hits 5346 5242 -104
- Misses 792 1025 +233
|
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.
All code changes in this PR are mechanical, except for the obvious (add EM
to ruff config, bump Ruff version) and the ones noted below:
hooks: | ||
- id: ruff | ||
types_or: [python, pyi, jupyter] |
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.
This has since become the default for Ruff, so we can remove it
"TCH", # manage type checking blocks | ||
"TC", # manage type checking blocks |
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.
This has been renamed by Ruff
src/anndata/_core/aligned_mapping.py
Outdated
raise KeyError( | ||
"'{key!r}' not found in view of {self.attrname}" | ||
) # Make sure it exists before bothering with a copy | ||
msg = f"'{key!r}' not found in view of {self.attrname}" | ||
raise KeyError(msg) # Make sure it exists before bothering with a copy |
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.
I spotted this error: There was an f
missing, so this error message was pretty useless
add_note(e, f"for option {repr(option)}") | ||
add_note(e, f"for option {option!r}") |
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.
I changed this to use the format specifier !r
instead of repr
. (and did the same ~2 other times)
from anndata import AnnData, ImplicitModificationWarning, read_h5ad, read_loom | ||
from anndata import AnnData, ImplicitModificationWarning, read_h5ad | ||
from anndata.io import read_loom |
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.
Independent driveby fix, sorry!
Owee, I'm MrMeeseeks, Look at me. There seem to be a conflict, please backport manually. Here are approximate instructions:
And apply the correct labels and milestones. Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon! Remember to remove the If these instructions are inaccurate, feel free to suggest an improvement. |
Since Ruff 0.9 touches a bunch of Exception instantiations, I thought adding the EM lints now is a good time. See #1241
The coverage issues are expected as we don’t test some just-in-case exception raisings. So a PR touching many spots that involve instantiating exceptions will have low coverage.