Skip to content

CI make some more hooks manual #50188

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

Merged

Conversation

MarcoGorelli
Copy link
Member

@MarcoGorelli MarcoGorelli commented Dec 11, 2022

This was brought up by @jorisvandenbossche in Slack - autotyping is the slowest hook, and is really unlikely to fail for most contributions. Shall we just mark it as being in the manual hook-stage, so it'll still run on CI but won't slow down people's local development too much?

Similar story for yesqa

It may be possible to replace flake8 with the much faster ruff, but that's for a separate PR


Durations from CI when running on all files:

In [30]: pd.DataFrame(res).astype({'duration': float}).sort_values('duration', ascending=False)
Out[30]:
                               id  duration
38                     autotyping     77.60
9                          flake8     74.46
17                          black     51.33
16                          yesqa     35.31
11                      pyupgrade     21.21
15                    sphinx-lint     13.14
1                         vulture      9.92
3                     cython-lint      6.54
10                          isort      6.14
5                debug-statements      5.08
0                absolufy-imports      4.83
18                     flake8-rst      3.32
8                         cpplint      1.58
2                       codespell      1.55
29          use-io-common-urlopen      1.21
19              unwanted-patterns      1.00
35      validate-errors-locations      0.85
14     rst-inline-touching-normal      0.79
36                     flake8-pyi      0.77
28           use-pd_array-in-core      0.77
13           rst-directive-colons      0.60
4     double-quote-cython-strings      0.52
7             trailing-whitespace      0.33
12                  rst-backticks      0.25
23         np-testing-array-equal      0.24
21            incorrect-backticks      0.20
31            no-return-exception      0.18
20                 cython-casting      0.15
30        no-bool-in-core-generic      0.13
26           sync-flake8-versions      0.12
24             invalid-ea-testing      0.11
22                 seed-check-asv      0.11
37             future-annotations      0.11
33        pg8000-not-installed-CI      0.11
6               end-of-file-fixer      0.10
25                   pip-to-conda      0.09
34  validate-min-versions-in-sync      0.07
27           title-capitalization      0.06
32       pandas-errors-documented      0.05

@MarcoGorelli MarcoGorelli added CI Continuous Integration Code Style Code style, linting, code_checks labels Dec 11, 2022
@jorisvandenbossche
Copy link
Member

Shall we just mark it as being in the manual hook-stage, so it'll still run on CI but won't slow down people's local development too much?

+1

@jbrockmendel
Copy link
Member

on all files

is it possible/reasonable to make these run only on files that a PR edits? e.g. in my .bash_aliases i have alias pflake="git diff --name-only | grep '\.py$' | xargs flake8"

@MarcoGorelli
Copy link
Member Author

Not sure what you mean exactly, but when running locally, pre-commit already runs only on modified files, whereas in CI we run it all files

Running it only on modified files in CI would potentially leave issues unaddressed

@MarcoGorelli MarcoGorelli added this to the 2.0 milestone Dec 13, 2022
@MarcoGorelli MarcoGorelli merged commit a955989 into pandas-dev:main Dec 13, 2022
@jorisvandenbossche
Copy link
Member

Thanks Marco!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Continuous Integration Code Style Code style, linting, code_checks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants