-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
CI: flake8-pyi #47595
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
CI: flake8-pyi #47595
Conversation
@@ -229,3 +229,11 @@ repos: | |||
entry: python scripts/validate_min_versions_in_sync.py | |||
language: python | |||
files: ^(ci/deps/actions-.*-minimum_versions\.yaml|pandas/compat/_optional\.py)$ | |||
- id: flake8-pyi | |||
name: flake8-pyi | |||
entry: flake8 --extend-ignore=E301,E302,E305,E701,E704 |
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.
flake8 doesn't like black's formatting in pyi files
# Use typing_extensions.TypeAlias for type aliases | ||
Y026, | ||
# Use "collections.abc.*" instead of "typing.*" (PEP 585 syntax) | ||
Y027 |
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.
Y002: we have one if TYPE_CHECKING
, without it mypy cannot infer some types (too many cyclic dependencies or does it hide actual errors?)
Y019: pandas does not (explicitly) depend on typeshed/typing_extension
Y021: some files have notes on how the cython and python types relate to each other
Y026: pandas does not (explicitly) depend on typing_extension
Y027: let's wait until we also do that change for the in-line annotations
entry: flake8 --extend-ignore=E301,E302,E305,E701,E704 | ||
types: [pyi] | ||
language: python | ||
additional_dependencies: |
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.
Could these be added to flake8_dependencies
in the flake8 block above and then this line changed to additional_dependencies: *flake8_dependencies
?
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 first tried to add flake8-pyi
to all the other flake8 plugins but the issue is that we need different ignores for pyi files than for normal py files.
I think flake8 supports file-specific ignores. If they support something along the lines *.pyi: E301,E302,E305,E701,E704
that would be the best approach. I'll look into that later today.
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.
Thanks. That can be a followup PR if it works.
Thanks @twoertwein |
No description provided.