-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BLD: Run flake8 check on Cython files in pre-commit #30847
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
Conversation
.flake8.cython
Outdated
@@ -0,0 +1,3 @@ | |||
[flake8] | |||
filename = *.pyx,*.pxd,*.pxi |
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.
Not sure if it's a typo or it's intentional, but we used to validate only pyx
files for these errors, and the CI is failing because there are pxd
and pxi
files that got errors.
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.
Yes this is a typo. I separated it out to another .flake8
, pushed the fix.
@datapythonista Fixed the configuration, CI now passes. |
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.
Looks good, I'd probably have the flake config files somewhere else, since we've already got too much in our root, but other than that looks good. I'll let someone else to review, since I'm not using pre-config myself.
@TomAugspurger if you're not busy with the RC, I guess you may want to have a look here.
I think 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.
lgtm
flake8/cython-header.cfg
Outdated
@@ -0,0 +1,4 @@ | |||
[flake8] | |||
filename = *.pxd,*.pxi.in |
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.
Can the template files go in with the normal pyx files? I think they would be closer to that than the header files
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.
@xhochy can you check this? I think good to go otherwise
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.
pxd
can go with the normal pyx
files but the pxi.in
raise a lot of errors, especially with indentation. I guess that the current indentation is actually sometimes preferred to the flake8 one as it makes the templates more readable.
@jbrockmendel can you try this out |
I'm missing something from the workflow. I've checked out this branch, added a flake-violation to groupby.pyx, but commiting it doesnt seem to cause any problem. What am I missing? Can W293 for trailing whitespace be added? Not a deal-breaker, but I like the more verbose way we list codes in statsmodels: https://github.com/statsmodels/statsmodels/blob/master/setup.cfg#L73 |
The obvious one: Otherwise: Can you tell me what you did change? Then I can try to reproduce locally. |
rebased and CI passed. |
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.
lgtm
Looks like LGTM W293 can be follow-up. |
Thanks @xhochy |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff