From d553603ca18302e774c362849750365ed50519c8 Mon Sep 17 00:00:00 2001 From: Josh Friend Date: Tue, 18 Feb 2014 11:24:10 -0500 Subject: [PATCH 1/4] using python to check system platform instead of $OS makefile variable which detects cygwin the same as windows shell. --- Makefile | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 733323f..38c8bde 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,9 @@ ENV := env DEPENDS := $(ENV)/.depends EGG_INFO := $(subst -,_,$(PROJECT)).egg-info -ifeq ($(OS),Windows_NT) +PLATFORM := $(shell python -c 'import sys; print sys.platform') + +ifneq ($(findstring win32, $(PLATFORM)), ) SYS_PYTHON := C:\\Python33\\python.exe SYS_VIRTUALENV := C:\\Python33\\Scripts\\virtualenv.exe BIN := $(ENV)/Scripts @@ -20,6 +22,7 @@ else BIN := $(ENV)/bin OPEN := open endif + MAN := man SHARE := share @@ -58,6 +61,10 @@ $(DEPENDS): .PHONY: doc doc: readme apidocs +version: + @echo $(PLATFORM) + @echo $(SYS_PYTHON) + .PHONY: readme readme: depends docs/README-github.html docs/README-pypi.html docs/README-github.html: README.md @@ -82,7 +89,7 @@ read: doc .PHONY: pep8 pep8: depends - $(PEP8) $(PACKAGE) --ignore=E501 + $(PEP8) $(PACKAGE) --ignore=E501 .PHONY: pylint pylint: depends @@ -112,7 +119,7 @@ tests: env depends clean: .clean-dist .clean-test .clean-doc .clean-build .PHONY: clean-all -clean-all: clean .clean-env +clean-all: clean .clean-env .PHONY: .clean-env .clean-env: @@ -143,7 +150,7 @@ dist: env depends check test tests doc $(PYTHON) setup.py sdist $(PYTHON) setup.py bdist_wheel $(MAKE) read - + .PHONY: upload upload: env depends doc $(PYTHON) setup.py register sdist upload From 0185b4267f6cf0046c8d3573bfa24932e21f09ed Mon Sep 17 00:00:00 2001 From: Josh Friend Date: Tue, 18 Feb 2014 14:02:27 -0500 Subject: [PATCH 2/4] added ability to have separate unit/integration test requirements --- Makefile | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 38c8bde..1d637e1 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,11 @@ PROJECT := Foobar PACKAGE := foobar SOURCES := Makefile setup.py $(shell find $(PACKAGE) -name '*.py') +TEST_DIR := test ENV := env DEPENDS := $(ENV)/.depends +TEST_DEPENDS := $(ENV)/.test_depends EGG_INFO := $(subst -,_,$(PROJECT)).egg-info PLATFORM := $(shell python -c 'import sys; print sys.platform') @@ -56,15 +58,17 @@ $(DEPENDS): $(PIP) install docutils pdoc pep8 pylint nose coverage wheel touch $(DEPENDS) # flag to indicate dependencies are installed +.PHONY: test_depends +test_depends: .virtualenv $(TEST_DEPENDS) Makefile +$(TEST_DEPENDS): + $(PIP) install -f $(TEST_DIR)/requirements.txt + touch $(TEST_DEPENDS) # flag to indicate test dependencies are installed + # Documentation ############################################################## .PHONY: doc doc: readme apidocs -version: - @echo $(PLATFORM) - @echo $(SYS_PYTHON) - .PHONY: readme readme: depends docs/README-github.html docs/README-pypi.html docs/README-github.html: README.md From b3ed64968144425253d5b19210378bdd58817afa Mon Sep 17 00:00:00 2001 From: Josh Friend Date: Tue, 18 Feb 2014 14:42:11 -0500 Subject: [PATCH 3/4] removed test-depends junk --- Makefile | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 1d637e1..a107ce3 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,9 @@ PROJECT := Foobar PACKAGE := foobar SOURCES := Makefile setup.py $(shell find $(PACKAGE) -name '*.py') -TEST_DIR := test ENV := env DEPENDS := $(ENV)/.depends -TEST_DEPENDS := $(ENV)/.test_depends EGG_INFO := $(subst -,_,$(PROJECT)).egg-info PLATFORM := $(shell python -c 'import sys; print sys.platform') @@ -55,15 +53,9 @@ $(PIP): .PHONY: depends depends: .virtualenv $(DEPENDS) Makefile $(DEPENDS): - $(PIP) install docutils pdoc pep8 pylint nose coverage wheel + $(PIP) install docutils pdoc pep8 pylint nose coverage wheel mock touch $(DEPENDS) # flag to indicate dependencies are installed -.PHONY: test_depends -test_depends: .virtualenv $(TEST_DEPENDS) Makefile -$(TEST_DEPENDS): - $(PIP) install -f $(TEST_DIR)/requirements.txt - touch $(TEST_DEPENDS) # flag to indicate test dependencies are installed - # Documentation ############################################################## .PHONY: doc From dbf20ed67c00e1e316ed13556e4e31afbe4e4eef Mon Sep 17 00:00:00 2001 From: Jace Browning Date: Tue, 18 Feb 2014 22:28:50 -0500 Subject: [PATCH 4/4] Fixed embedded print statement for Python 3. This syntax will still work on Python 2. --- Makefile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index a107ce3..8f20888 100644 --- a/Makefile +++ b/Makefile @@ -6,20 +6,20 @@ ENV := env DEPENDS := $(ENV)/.depends EGG_INFO := $(subst -,_,$(PROJECT)).egg-info -PLATFORM := $(shell python -c 'import sys; print sys.platform') +PLATFORM := $(shell python -c 'import sys; print(sys.platform)') ifneq ($(findstring win32, $(PLATFORM)), ) - SYS_PYTHON := C:\\Python33\\python.exe - SYS_VIRTUALENV := C:\\Python33\\Scripts\\virtualenv.exe - BIN := $(ENV)/Scripts + SYS_PYTHON := C:\\Python33\\python.exe + SYS_VIRTUALENV := C:\\Python33\\Scripts\\virtualenv.exe + BIN := $(ENV)/Scripts EXE := .exe OPEN := cmd /c start # https://bugs.launchpad.net/virtualenv/+bug/449537 export TCL_LIBRARY=C:\\Python33\\tcl\\tcl8.5 else - SYS_PYTHON := python3 - SYS_VIRTUALENV := virtualenv - BIN := $(ENV)/bin + SYS_PYTHON := python3 + SYS_VIRTUALENV := virtualenv + BIN := $(ENV)/bin OPEN := open endif