Merge ~powersj/cloud-init:make-tox-revamp into cloud-init:master

Proposed by Joshua Powers
Status: Merged
Approved by: Scott Moser
Approved revision: 490cb302f6dd2e0c09471be3ff4944f1f7e2e1b9
Merged at revision: 3bcb72c593f13915a81272778809dd8e71e2c7b7
Proposed branch: ~powersj/cloud-init:make-tox-revamp
Merge into: cloud-init:master
Diff against target: 36 lines (+12/-1)
2 files modified
Makefile (+4/-1)
tox.ini (+8/-0)
Reviewer Review Type Date Requested Status
cloud-init Commiters Pending
Review via email: mp+315940@code.launchpad.net

Commit message

Remove style checking during build and add latest style checks to tox

- make check will no longer run the style checks
- created style-check make file target to continue to run pep8 and pyflakes
- added tox envs 'tip-pycodestyle' and 'tip-pyflakes' to run latest style checking

LP: #1652329

Description of the change

Remove style checking during build and add latest style checks to tox

- make check will no longer run the style checks
- created style-check make file target to continue to run pep8 and pyflakes
- added tox envs 'tip-pycodestyle' and 'tip-pyflakes' to run latest style checking

Example tox run with the tip envs:
https://paste.ubuntu.com/23895229/

Did look into adding docs to default tox run, but the test reaches out to an external website (http://sphinx.pocoo.org/objects.inv) that may or may not always be available to a test runner. The test only adds 2.5 seconds to a run on my local system. However due to the external website requirement I did NOT add it to the default tox run.

Also looked into running pylint against cloud-init:

With Errors, Warnings, Refactors, and Conventions
https://paste.ubuntu.com/23895198/ (7000 lines)

With only errors:
https://paste.ubuntu.com/23895206/ (390 lines)

To post a comment you must log in.
Revision history for this message
Scott Moser (smoser) wrote :

(I wrote this stuff as I thought through it... so largely pasting here for my own review later).

summary: looks good. thanks.

 - flake8 integrates pyflakes and pycodestyle and McCabe tool.
   I think having separate tip-pyflakes and tip-pycodestyle seems
   like the right thing to do, compared to having just a tip-flake8.

   One reason for this is that currently flake8 pins the version
   of pep8 to 1.5.X, and the goal of 'tip-' is to let that flow.

 - The other thing we have specifically for flake8 is the [flake8] section
   in tox.

   This has 2 things
   a.) 'ignore=H...'
     these specify to ignore warnings raised by 'hacking's integration
     with flake8 specifically (not pyflakes or pycodestyle).
     Since tip-* wont ave hacking (i'm fine with that), we dont need it.

     summary: we can leave the ignore= lines safely as they are.

   b.) exclude =
     this does not seem problematic. i guess this is useful if you
     ran 'flake8' with no arguments, but tox passes arguments and i'm fine
     with that.

     summary: not a problem.

There was an error fetching revisions from git servers. Please try again in a few minutes. If the problem persists, contact Launchpad support.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/Makefile b/Makefile
2index 18ec568..5940ed7 100644
3--- a/Makefile
4+++ b/Makefile
5@@ -34,7 +34,9 @@ CODE_VERSION=$(shell $(PYVER) -c "from cloudinit import version; print(version.v
6
7 all: check
8
9-check: check_version pep8 $(pyflakes) test $(yaml)
10+check: check_version test $(yaml)
11+
12+style-check: pep8 $(pyflakes)
13
14 pep8:
15 @$(CWD)/tools/run-pep8
16@@ -84,3 +86,4 @@ deb:
17
18 .PHONY: test pyflakes pyflakes3 clean pep8 rpm deb yaml check_version
19 .PHONY: pip-test-requirements pip-requirements clean_pyc unittest unittest3
20+.PHONY: style-check
21diff --git a/tox.ini b/tox.ini
22index e79ea6a..ca5d8b8 100644
23--- a/tox.ini
24+++ b/tox.ini
25@@ -79,3 +79,11 @@ deps =
26 jsonpatch==1.2
27 six==1.9.0
28 -r{toxinidir}/test-requirements.txt
29+
30+[testenv:tip-pycodestyle]
31+commands = {envpython} -m pycodestyle {posargs:cloudinit/ tests/ tools/}
32+deps = pycodestyle
33+
34+[testenv:tip-pyflakes]
35+commands = {envpython} -m pyflakes {posargs:cloudinit/ tests/ tools/}
36+deps = pyflakes

Subscribers

People subscribed via source and target branches