← Back to team overview

cloud-init-dev team mailing list archive

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

 

Joshua Powers has proposed merging ~powersj/cloud-init:make-tox-revamp into cloud-init:master.

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

Requested reviews:
  cloud init development team (cloud-init-dev)

For more details, see:
https://code.launchpad.net/~powersj/cloud-init/+git/cloud-init/+merge/315940

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)
-- 
Your team cloud init development team is requested to review the proposed merge of ~powersj/cloud-init:make-tox-revamp into cloud-init:master.
diff --git a/Makefile b/Makefile
index 18ec568..5940ed7 100644
--- a/Makefile
+++ b/Makefile
@@ -34,7 +34,9 @@ CODE_VERSION=$(shell $(PYVER) -c "from cloudinit import version; print(version.v
 
 all: check
 
-check: check_version pep8 $(pyflakes) test $(yaml)
+check: check_version test $(yaml)
+
+style-check: pep8 $(pyflakes)
 
 pep8:
 	@$(CWD)/tools/run-pep8
@@ -84,3 +86,4 @@ deb:
 
 .PHONY: test pyflakes pyflakes3 clean pep8 rpm deb yaml check_version
 .PHONY: pip-test-requirements pip-requirements clean_pyc unittest unittest3
+.PHONY: style-check
diff --git a/tox.ini b/tox.ini
index e79ea6a..ca5d8b8 100644
--- a/tox.ini
+++ b/tox.ini
@@ -79,3 +79,11 @@ deps =
     jsonpatch==1.2
     six==1.9.0
     -r{toxinidir}/test-requirements.txt
+
+[testenv:tip-pycodestyle]
+commands = {envpython} -m pycodestyle {posargs:cloudinit/ tests/ tools/}
+deps = pycodestyle
+
+[testenv:tip-pyflakes]
+commands = {envpython} -m pyflakes {posargs:cloudinit/ tests/ tools/}
+deps = pyflakes

Follow ups