diff options
author | Ryan Harper <ryan.harper@canonical.com> | 2016-03-03 17:16:13 -0600 |
---|---|---|
committer | Ryan Harper <ryan.harper@canonical.com> | 2016-03-03 17:16:13 -0600 |
commit | 63357ed731710b2418810535d9c991adbaea8dcb (patch) | |
tree | 5c553b0671669beb204c4edb3d82ebeda78d7cd3 /Makefile | |
parent | b1046db66bbed6a063f218992449b8abfd1ae99b (diff) | |
parent | 3d9153d16b194e7a3139c290e723ef17518e617d (diff) | |
download | vyos-cloud-init-63357ed731710b2418810535d9c991adbaea8dcb.tar.gz vyos-cloud-init-63357ed731710b2418810535d9c991adbaea8dcb.zip |
Apply pep8, pyflakes fixes for python2 and 3
Update make check target to use pep8, pyflakes, pyflakes3.
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 22 |
1 files changed, 14 insertions, 8 deletions
@@ -1,13 +1,13 @@ CWD=$(shell pwd) PY_FILES=$(shell find cloudinit bin tests tools -name "*.py" -type f ) PY_FILES+="bin/cloud-init" -noseopts ?= -v YAML_FILES=$(shell find cloudinit bin tests tools -name "*.yaml" -type f ) YAML_FILES+=$(shell find doc/examples -name "cloud-config*.txt" -type f ) CHANGELOG_VERSION=$(shell $(CWD)/tools/read-version) CODE_VERSION=$(shell python -c "from cloudinit import version; print version.version_string()") +noseopts ?= -vv --nologcapture PIP_INSTALL := pip install @@ -17,13 +17,20 @@ endif all: check -check: test check_version pyflakes +check: check_version pep8 pyflakes pyflakes3 test pep8: - @$(CWD)/tools/run-pep8 $(PY_FILES) + @$(CWD)/tools/run-pep8 pyflakes: - @pyflakes $(PY_FILES) + @$(CWD)/tools/run-pyflakes + +pyflakes3: + @$(CWD)/tools/run-pyflakes3 + +unittest: clean_pyc + nosetests $(noseopts) tests/unittests + nosetests3 $(noseopts) tests/unittests pip-requirements: @echo "Installing cloud-init dependencies..." @@ -33,8 +40,7 @@ pip-test-requirements: @echo "Installing cloud-init test dependencies..." $(PIP_INSTALL) -r "$@.txt" -q -test: clean_pyc - @n=$$(which nosetests3) || n=nosetests; set -- $$n $(noseopts) tests/; echo "Running $$*"; "$$@" +test: unittest check_version: @if [ "$(CHANGELOG_VERSION)" != "$(CODE_VERSION)" ]; then \ @@ -60,5 +66,5 @@ rpm: deb: ./packages/bddeb -.PHONY: test pyflakes 2to3 clean pep8 rpm deb yaml check_version -.PHONY: pip-test-requirements pip-requirements clean_pyc +.PHONY: test pyflakes pyflakes3 2to3 clean pep8 rpm deb yaml check_version +.PHONY: pip-test-requirements pip-requirements clean_pyc unittest |