8000 Run flake8 in a separate travis environment by timhoffm · Pull Request #12708 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Run flake8 in a separate travis environment #12708

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 5, 2018

Conversation

timhoffm
Copy link
Member
@timhoffm timhoffm commented Nov 1, 2018

PR Summary

Follow up to #12523. Discussion at #12523 (comment)

This PR sets up a separate travis environment to run flake8 independently of the tests. The issue with the current behavior of running flake8 after the tests results is that a flake8 issue only becomes visible after the long test run.

@timhoffm timhoffm force-pushed the travis-flake8-env branch 5 times, most recently from 0d7db82 to 60bccc7 Compare November 1, 2018 23:24
@timhoffm timhoffm changed the title WIP: Run flake8 in a separate travis environment Run flake8 in a separate travis environment Nov 3, 2018
@timhoffm
Copy link
Member Author
timhoffm commented Nov 3, 2018

Works now. Maybe the environment for flake8 can be stripped down further to speed up more. However, I'm not that much into the build process, to know what could be left out.

@ImportanceOfBeingErnest
Copy link
Member

Would it make sense to remove flake8 testing from the python3.6 environment then? Else flake is tested twice.

@timhoffm
8000
Copy link
Member Author
timhoffm commented Nov 3, 2018

flake8 is removed from python3.6. See the .travis.yml:80 in the changes.

What may confuse you is the log:

$ if [[ $RUN_FLAKE8 == 1 ]]; then
  flake8 --statistics && echo "Flake8 passed without any issues!"
fi

The command "if [[ $RUN_FLAKE8 == 1 ]]; then
  flake8 --statistics && echo "Flake8 passed without any issues!"
fi
" exited with 0.

Travis is quite verbose in repeating the command, which in this case is the conditional. Since the output "Flake8 passed without any issues!" is not there, you can see that it has not run. One could add an else echo "Flake8 skipped." clause, but I doubt that it would significantly improve the situation as the command gets more verbose.

The only way to make this more readable would be to move the commands into separte script files. However, there was some opposition last time that came up.


flake8
flake8-per-file-ignores
ipykernel
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need these last 4 dependencies to run flake8?

Copy link
Member Author

Choose a reason for hiding this comment

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

Likely, we don't need these. I just replicated the 3.6 environment to be on the safe side. Removed now.

Am I correct, that flake8 just parses the source but does not import it? In that case we probably wouldn't need a lot of the apt packages as well for this environment. However that would require some reorganization of the .travis.yml config.

Copy link
Member

Choose a reason for hiding this comment

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

Correct.

Copy link
Member Author

Choose a reason for hiding this comment

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

Would there be interest in reorganizing this stuff (likely need to move some things into files in requirements/testing) or should I leave .travis.yml as is?

Copy link
Member

Choose a reason for hiding this comment

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

I think there is interest in re-organizing, particularly if the flake8 build can be made faster. We merged to move it along, but further refinement welcome...

@tacaswell tacaswell added this to the v3.0.x milestone Nov 4, 2018
@jklymak jklymak merged commit 2f0e119 into matplotlib:master Nov 5, 2018
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Nov 5, 2018
@timhoffm timhoffm deleted the travis-flake8-env branch November 5, 2018 20:36
tacaswell added a commit that referenced this pull request Nov 5, 2018
…708-on-v3.0.x

Backport PR #12708 on branch v3.0.x (Run flake8 in a separate travis environment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0