From 9bef57aefa5bcf59565894d5cda6e8d5240dc11f Mon Sep 17 00:00:00 2001 From: Josh Friend Date: Sat, 22 Feb 2014 01:19:07 -0500 Subject: [PATCH 1/2] Finished pep257 update Also updated foobar package to pass pep257 checks. pep/pylint checkers are in depends-dev, nose/test related packages are in depends-test. --- Makefile | 18 ++++++++---------- foobar/__init__.py | 4 +--- foobar/test/__init__.py | 4 +--- 3 files changed, 10 insertions(+), 16 deletions(-) diff --git a/Makefile b/Makefile index 4431c5e..e79f417 100644 --- a/Makefile +++ b/Makefile @@ -36,6 +36,7 @@ PIP := $(BIN)/pip$(EXE) RST2HTML := $(BIN)/rst2html.py PDOC := $(BIN)/pdoc PEP8 := $(BIN)/pep8$(EXE) +PEP257 := $(BIN)/pep257$(EXE) PYLINT := $(BIN)/pylint$(EXE) NOSE := $(BIN)/nosetests$(EXE) @@ -61,13 +62,13 @@ depends: .depends-test .depends-dev .PHONY: .depends-test .depends-test: .virtualenv Makefile $(DEPENDS_TEST) $(DEPENDS_TEST): - $(PIP) install pep8 pep257 nose coverage + $(PIP) install nose coverage touch $(DEPENDS_TEST) # flag to indicate dependencies are installed .PHONY: .depends-dev .depends-dev: .virtualenv Makefile $(DEPENDS_DEV) $(DEPENDS_DEV): - $(PIP) install docutils pdoc pylint wheel + $(PIP) install docutils pdoc pep8 pep257 pylint wheel touch $(DEPENDS_DEV) # flag to indicate dependencies are installed # Documentation ############################################################## @@ -98,25 +99,22 @@ read: doc # Static Analysis ############################################################ .PHONY: pep8 -pep8: .depends-test +pep8: .depends-dev $(PEP8) $(PACKAGE) --ignore=E501 .PHONY: pep257 -pep257: .depends-test - $(PEP257) $(PACKAGE) --ignore=E501 +pep257: .depends-dev + $(PEP257) $(PACKAGE) .PHONY: pylint -pylint: depends +pylint: .depends-dev $(PYLINT) $(PACKAGE) --reports no \ --msg-template="{msg_id}:{line:3d},{column}:{msg}" \ --max-line-length=79 \ --disable=I0011,W0142,W0511,R0801 .PHONY: check -check: pep8 pylint pep257 - $(MAKE) pep8 - $(MAKE) pep257 - $(MAKE) pylint +check: pep8 pep257 pylint # Testing #################################################################### diff --git a/foobar/__init__.py b/foobar/__init__.py index ba05192..b90ffdc 100644 --- a/foobar/__init__.py +++ b/foobar/__init__.py @@ -1,8 +1,6 @@ #!/usr/bin/env python -""" -Package for Foobar. -""" +"""Package for Foobar.""" __project__ = 'Foobar' __version__ = '0.0.0' diff --git a/foobar/test/__init__.py b/foobar/test/__init__.py index 49b5f08..671f678 100644 --- a/foobar/test/__init__.py +++ b/foobar/test/__init__.py @@ -1,5 +1,3 @@ #!/usr/bin/env python -""" -Tests for the foobar package. -""" +"""Tests for the foobar package.""" From 1dbd441a810325e1f5f42978fbb76b2e161b1839 Mon Sep 17 00:00:00 2001 From: Jace Browning Date: Sat, 22 Feb 2014 10:35:20 -0500 Subject: [PATCH 2/2] Added 'ci' target. --- .travis.yml | 2 +- Makefile | 29 ++++++++++++++++------------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/.travis.yml b/.travis.yml index d8944fa..ceec1d9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,6 @@ python: - 3.3 install: - pip install coveralls -script: make pep8 pep257 test tests +script: make ci after_success: - coveralls diff --git a/Makefile b/Makefile index 14595cb..31fc2fa 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ PACKAGE := foobar SOURCES := Makefile setup.py $(shell find $(PACKAGE) -name '*.py') ENV := env -DEPENDS_TEST := $(ENV)/.depends.test +DEPENTS_CI := $(ENV)/.depends.ci DEPENDS_DEV := $(ENV)/.depends.dev EGG_INFO := $(subst -,_,$(PROJECT)).egg-info @@ -57,13 +57,13 @@ $(PIP): $(SYS_VIRTUALENV) --python $(SYS_PYTHON) $(ENV) .PHONY: depends -depends: .depends-test .depends-dev +depends: .depends-ci .depends-dev -.PHONY: .depends-test -.depends-test: .virtualenv Makefile $(DEPENDS_TEST) -$(DEPENDS_TEST): +.PHONY: .depends-ci +.depends-ci: .virtualenv Makefile $(DEPENTS_CI) +$(DEPENTS_CI): $(PIP) install pep8 pep257 nose coverage - touch $(DEPENDS_TEST) # flag to indicate dependencies are installed + touch $(DEPENTS_CI) # flag to indicate dependencies are installed .PHONY: .depends-dev .depends-dev: .virtualenv Makefile $(DEPENDS_DEV) @@ -77,7 +77,7 @@ $(DEPENDS_DEV): doc: readme apidocs .PHONY: readme -readme: depends docs/README-github.html docs/README-pypi.html +readme: .depends-ci docs/README-github.html docs/README-pypi.html docs/README-github.html: README.md pandoc -f markdown_github -t html -o docs/README-github.html README.md docs/README-pypi.html: README.rst @@ -86,7 +86,7 @@ README.rst: README.md pandoc -f markdown_github -t rst -o README.rst README.md .PHONY: apidocs -apidocs: depends apidocs/$(PACKAGE)/index.html +apidocs: .depends-ci apidocs/$(PACKAGE)/index.html apidocs/$(PACKAGE)/index.html: $(SOURCES) $(PYTHON) $(PDOC) --html --overwrite $(PACKAGE) --html-dir apidocs @@ -99,15 +99,15 @@ read: doc # Static Analysis ############################################################ .PHONY: pep8 -pep8: env .depends-test +pep8: env .depends-ci $(PEP8) $(PACKAGE) --ignore=E501 .PHONY: pep257 -pep257: env .depends-test +pep257: env .depends-ci $(PEP257) $(PACKAGE) --ignore=E501 .PHONY: pylint -pylint: env .depends-test +pylint: env .depends-ci $(PYLINT) $(PACKAGE) --reports no \ --msg-template="{msg_id}:{line:3d},{column}:{msg}" \ --max-line-length=79 \ @@ -119,13 +119,16 @@ check: pep8 pep257 pylint # Testing #################################################################### .PHONY: test -test: env .depends-test +test: env .depends-ci $(NOSE) .PHONY: tests -tests: env .depends-test +tests: env .depends-ci TEST_INTEGRATION=1 $(NOSE) --verbose --stop --cover-package=$(PACKAGE) +.PHONY: ci +ci: pep8 pep257 test tests + # Cleanup #################################################################### .PHONY: clean