From a6f387756d74e0542f2247de8cab617043297ced Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Fri, 15 Jun 2012 17:42:05 -0700 Subject: Updated so that pylint and pyflakes will now run over cloudinit/ and bin/ python files --- Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 0fc6c46b..0a73f987 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,13 @@ +CWD=$(shell pwd) +PY_FILES=$(shell find cloudinit bin -name "*.py") all: test pylint: - pylint cloudinit + $(CWD)/tools/run-pylint $(PY_FILES) pyflakes: - pyflakes . + pyflakes $(PY_FILES) test: nosetests tests/unittests/ -- cgit v1.2.3 From 5c34aa4ec384c25056b76e71cae9afabd00f793b Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Sat, 16 Jun 2012 07:32:18 -0700 Subject: Add the running of 2to3 via the makefile. --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 0a73f987..783ebd76 100644 --- a/Makefile +++ b/Makefile @@ -12,5 +12,8 @@ pyflakes: test: nosetests tests/unittests/ -.PHONY: test pylint pyflakes +2to3: + 2to3 $(PY_FILES) + +.PHONY: test pylint pyflakes 2to3 -- cgit v1.2.3 From d42536f0c8a0e7eb84248c7f4f3264c317a9a04d Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Mon, 18 Jun 2012 17:21:15 -0700 Subject: 1. Add in a clean section that will remove the /var/lib/cloud dir and the cloud.log file (helpful for testing) --- Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 783ebd76..683475fd 100644 --- a/Makefile +++ b/Makefile @@ -15,5 +15,9 @@ test: 2to3: 2to3 $(PY_FILES) -.PHONY: test pylint pyflakes 2to3 +clean: + rm -rf /var/log/cloud-init.log \ + /var/lib/cloud/ + +.PHONY: test pylint pyflakes 2to3 clean -- cgit v1.2.3 From cedb76f729ae0e324992ff0568e299b7cd12f2cd Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Wed, 20 Jun 2012 16:06:24 -0700 Subject: Add in the new binary to be used in files found. --- Makefile | 1 + 1 file changed, 1 insertion(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 683475fd..82c5dedb 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,6 @@ CWD=$(shell pwd) PY_FILES=$(shell find cloudinit bin -name "*.py") +PY_FILES+="bin/cloud-init" all: test -- cgit v1.2.3 From d4d93f0afda6fde915893e487ef6b0d1adaa0e7e Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Thu, 21 Jun 2012 13:13:19 -0700 Subject: Pass along any environment settings via the variable 'noseopts' --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 82c5dedb..ab23bf1f 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ pyflakes: pyflakes $(PY_FILES) test: - nosetests tests/unittests/ + nosetests $(noseopts) tests/unittests/ 2to3: 2to3 $(PY_FILES) -- cgit v1.2.3 From 67232af3cba2c7bc99c2ca67b83470b38d6db103 Mon Sep 17 00:00:00 2001 From: harlowja Date: Sat, 23 Jun 2012 14:59:16 -0700 Subject: 1. Separate the pep8 check from the pylint check a. This allows them to be run as different tools (if desired) 2. Adjust the makefile to have a 'make pep8' section which can run this new script --- Makefile | 5 ++++- tools/run-pep8 | 28 ++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100755 tools/run-pep8 (limited to 'Makefile') diff --git a/Makefile b/Makefile index ab23bf1f..c20dfbd3 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,9 @@ PY_FILES+="bin/cloud-init" all: test +pep8: + $(CWD)/tools/run-pep8 $(PY_FILES) + pylint: $(CWD)/tools/run-pylint $(PY_FILES) @@ -20,5 +23,5 @@ clean: rm -rf /var/log/cloud-init.log \ /var/lib/cloud/ -.PHONY: test pylint pyflakes 2to3 clean +.PHONY: test pylint pyflakes 2to3 clean pep8 diff --git a/tools/run-pep8 b/tools/run-pep8 new file mode 100755 index 00000000..e7707985 --- /dev/null +++ b/tools/run-pep8 @@ -0,0 +1,28 @@ +#!/bin/bash + +ci_files='cloud*.py cloudinit/*.py cloudinit/config/*.py' +test_files=$(find tests -name "*.py") +def_files="$ci_files $test_files" + +if [ $# -eq 0 ]; then + files=( ) + for f in $def_files; do + [ -f "$f" ] || { echo "failed, $f not a file" 1>&2; exit 1; } + files[${#files[@]}]=${f} + done +else + files=( "$@" ); +fi + +cmd=( + pep8 + + --ignore=E501 # Line too long (these are caught by pylint) + + "${files[@]}" +) + +echo -e "\nRunning pep8:" +echo "${cmd[@]}" +"${cmd[@]}" + -- cgit v1.2.3 From fee2be4e11a82dea55e53c5e5fb48e7776d0d93a Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Tue, 26 Jun 2012 00:10:30 -0700 Subject: Add a section for building an rpm and a section for building a deb --- Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index c20dfbd3..a96d6b5b 100644 --- a/Makefile +++ b/Makefile @@ -23,5 +23,11 @@ clean: rm -rf /var/log/cloud-init.log \ /var/lib/cloud/ -.PHONY: test pylint pyflakes 2to3 clean pep8 +rpm: + cd packages && ./brpm + +deb: + cd packages && ./bddeb + +.PHONY: test pylint pyflakes 2to3 clean pep8 rpm deb -- cgit v1.2.3