-
Notifications
You must be signed in to change notification settings - Fork 89
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: drop isort
config, require annotation imports
#2801
Conversation
Codecov Report
Additional details and impacted files
|
@henryiii have you come across a mechanism for scoping |
You can disable I101 for subsets of files. Sadly, that drops everything, not just the isort addition. There will be a way to do it with PEP 723 if that gets implemented per file. You can also put a |
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.
If we're going to be touching all of these files, anyway, let's clean up some long-standing format issues.
- GitHub website (dropping the "-1.0")
- uniform placement of the LICENSE line
- uniform vertical spacing in the first few lines
- uniform placement of
__all__
relative to imports.
Since the new from __future__ import annotations
goes first, I put the __all__
after all imports. There's usually a few more assignments in that position, so it fits in, but it's always separated from them by at least a linefeed.
This includes touching the C++ code, since those files had inconsistent LICENSE messages, too. If you want to avoid triggering a new awkward-cpp right now, we can revert the last commit on the whole awkward-cpp directory.
Otherwise, I think this is ready to be merged.
This is now not needed, and isort is handled by ruff
…all__ placement, vertical spacing.
updates: - [github.com/astral-sh/ruff-pre-commit: v0.1.3 → v0.1.4](astral-sh/ruff-pre-commit@v0.1.3...v0.1.4) - [github.com/python-jsonschema/check-jsonschema: 0.27.0 → 0.27.1](python-jsonschema/check-jsonschema@0.27.0...0.27.1) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
6f3678c
to
073ac8d
Compare
Although I'm loathed to touch the C++ again, we really want to avoid these things living for a long time. As such, I'm just going to merge! Thanks all! |
This PR updates our linting rules to always require annotation module imports. This was inspired by the default in https://github.com/scientific-python/cookie
We also update the tests. I would probably prefer to allow the tests to skip this import, but it doesn't seem possible to do this at the moment, so let's just make life easy and impose the same rules for all source files.