Skip to content

CI: Exclude asv benchmark envs from flake8 checks #23497

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
merged 1 commit into from
Nov 6, 2018

Conversation

qwhelan
Copy link
Contributor

@qwhelan qwhelan commented Nov 4, 2018

When running ci/code_checks.sh on a local repository that has also been used to run asv benchmarks, flake8 also lints the environments created. This massively increases the runtime and leads to linting errors on non-pandas packages, which is not informative.

This change simply adds env to the flake8 exclude list, which resolves the issue seen above.

Before

~/projects/pandas$ LINT=true ./ci/code_checks.sh
inside ./ci/code_checks.sh

flake8 --version
3.6.0 (mccabe: 0.6.1, pycodestyle: 2.4.0, pyflakes: 2.0.0) CPython 3.6.5 on Linux
Linting .py code
./asv_bench/env/83b3be1235aa7b08e8a17448e2f70790/bin/runxlrd.py:18:80: E501 line too long (80 > 79 characters)
./asv_bench/env/83b3be1235aa7b08e8a17448e2f70790/bin/runxlrd.py:38:15: E401 multiple imports on one line
./asv_bench/env/83b3be1235aa7b08e8a17448e2f70790/bin/runxlrd.py:43:5: E303 too many blank lines (2)
./asv_bench/env/83b3be1235aa7b08e8a17448e2f70790/bin/runxlrd.py:65:24: E701 multiple statements on one line (colon)
./asv_bench/env/83b3be1235aa7b08e8a17448e2f70790/bin/runxlrd.py:66:19: E701 multiple statements on one line (colon)
./asv_bench/env/83b3be1235aa7b08e8a17448e2f70790/bin/runxlrd.py:71:25: E128 continuation line under-indented for visual indent
...

After

~/projects/pandas$ LINT=true ./ci/code_checks.sh
inside ./ci/code_checks.sh

flake8 --version
3.6.0 (mccabe: 0.6.1, pycodestyle: 2.4.0, pyflakes: 2.0.0) CPython 3.6.5 on Linux
Linting .py code
./versioneer.py:423:1: E305 expected 2 blank lines after class or function definition, found 1
./versioneer.py:467:1: E305 expected 2 blank lines after class or function definition, found 0
./versioneer.py:927:-11937: W605 invalid escape sequence '\s'

Output comparison

~/projects/pandas$ ls -altrh code_check*
-rw-rw-rw- 1 chris chris 32M Nov  4 12:31 code_check_old.log
-rw-rw-rw- 1 chris chris 14K Nov  4 12:33 code_check_new.log

Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can u move these to the setup.cfg section instead

@qwhelan
Copy link
Contributor Author

qwhelan commented Nov 4, 2018

@jreback Done

@gfyoung gfyoung added CI Continuous Integration Code Style Code style, linting, code_checks Refactor Internal refactoring of code labels Nov 4, 2018
@codecov
Copy link

codecov bot commented Nov 4, 2018

Codecov Report

Merging #23497 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #23497   +/-   ##
=======================================
  Coverage   92.23%   92.23%           
=======================================
  Files         161      161           
  Lines       51197    51197           
=======================================
  Hits        47220    47220           
  Misses       3977     3977
Flag Coverage Δ
#multiple 90.61% <ø> (ø) ⬆️
#single 42.27% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 391aded...f98f358. Read the comment docs.

Copy link
Member

@datapythonista datapythonista left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

You could add a comment too, something like env # directory created by asv after a run. Not being in the repo, we may have the temptation to delete it later on

@qwhelan
Copy link
Contributor Author

qwhelan commented Nov 5, 2018

@datapythonista Done

@jreback jreback added this to the 0.24.0 milestone Nov 6, 2018
@jreback jreback merged commit 1651a10 into pandas-dev:master Nov 6, 2018
@jreback
Copy link
Contributor

jreback commented Nov 6, 2018

thanks @qwhelan

JustinZhengBC pushed a commit to JustinZhengBC/pandas that referenced this pull request Nov 14, 2018
tm9k1 pushed a commit to tm9k1/pandas that referenced this pull request Nov 19, 2018
Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019
Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019
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 Refactor Internal refactoring of code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants