From 38b34dab43c4f7b448334c68057983b01f78499f Mon Sep 17 00:00:00 2001 From: Jace Browning Date: Tue, 18 Mar 2014 11:02:21 -0400 Subject: [PATCH 1/4] Added 'make exe'. PyInstaller is not recognizing pywin32 in the virtualenv. --- Makefile | 5 +++++ foobar/main.py | 12 ++++++++++++ setup.py | 2 +- 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 foobar/main.py diff --git a/Makefile b/Makefile index 5bda8c9..a8e499a 100644 --- a/Makefile +++ b/Makefile @@ -182,6 +182,11 @@ upload: .git-no-changes env depends doc $(PYTHON) setup.py register sdist upload $(PYTHON) setup.py bdist_wheel upload +.PHONY: exe +exe: env depends doc + $(BIN)/easy_install http://downloads.sourceforge.net/project/pywin32/pywin32/Build%20218/pywin32-218.win32-py3.3.exe + $(PIP) install pyinstaller + $(BIN)/pyinstaller $(PACKAGE)/main.py # System Installation ######################################################## diff --git a/foobar/main.py b/foobar/main.py new file mode 100644 index 0000000..09ed9a9 --- /dev/null +++ b/foobar/main.py @@ -0,0 +1,12 @@ +#!/usr/bin/env python + +"""Sample entry point.""" + + +def main(): + """Placeholder.""" + print("Hello, world!") + + +if __name__ == '__main__': + main() diff --git a/setup.py b/setup.py index 5436a7d..3307123 100644 --- a/setup.py +++ b/setup.py @@ -27,7 +27,7 @@ packages=setuptools.find_packages(), - entry_points={'console_scripts': []}, + entry_points={'console_scripts': ['foobar = foobar.main:main']}, long_description=(README + '\n' + CHANGES), license='WTFPL', From 80f8de6931465d693fad7ddaec524efa3a3708ef Mon Sep 17 00:00:00 2001 From: Jace Browning Date: Tue, 18 Mar 2014 11:12:11 -0400 Subject: [PATCH 2/4] Added a test to pass CI. --- foobar/main.py | 2 +- foobar/test/test_main.py | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 foobar/test/test_main.py diff --git a/foobar/main.py b/foobar/main.py index 09ed9a9..909b537 100644 --- a/foobar/main.py +++ b/foobar/main.py @@ -8,5 +8,5 @@ def main(): print("Hello, world!") -if __name__ == '__main__': +if __name__ == '__main__': # pragma: no cover main() diff --git a/foobar/test/test_main.py b/foobar/test/test_main.py new file mode 100644 index 0000000..fa47e0e --- /dev/null +++ b/foobar/test/test_main.py @@ -0,0 +1,18 @@ +#!/usr/bin/env python + +"""Tests for foobar.main.""" + +import unittest + +from foobar import main + + +class Test(unittest.TestCase): + + def test_main(self): + self.assertIs(None, main.main()) + + +if __name__ == "__main__": + # import sys;sys.argv = ['', 'Test.testName'] + unittest.main() From 11f2a79e6df17ac1e506b36233ea0c6719abeea7 Mon Sep 17 00:00:00 2001 From: Jace Browning Date: Wed, 19 Mar 2014 22:50:39 -0400 Subject: [PATCH 3/4] PyWin32 only needed on Windows --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index a8e499a..fdd8bb3 100644 --- a/Makefile +++ b/Makefile @@ -184,7 +184,9 @@ upload: .git-no-changes env depends doc .PHONY: exe exe: env depends doc +ifneq ($(findstring win32, $(PLATFORM)), ) $(BIN)/easy_install http://downloads.sourceforge.net/project/pywin32/pywin32/Build%20218/pywin32-218.win32-py3.3.exe +endif $(PIP) install pyinstaller $(BIN)/pyinstaller $(PACKAGE)/main.py From b7aa2c554b2557c68582772be5add5c234a465b4 Mon Sep 17 00:00:00 2001 From: Jace Browning Date: Thu, 24 Apr 2014 15:44:42 -0400 Subject: [PATCH 4/4] Moved pywin32 to CI dependencies. Still unable to pip install pyinstaller for Python 3. --- Makefile | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index fdd8bb3..e069f1d 100644 --- a/Makefile +++ b/Makefile @@ -59,15 +59,18 @@ $(PIP): depends: .depends-ci .depends-dev .PHONY: .depends-ci -.depends-ci: .virtualenv Makefile $(DEPENDS_CI) +.depends-ci: env Makefile $(DEPENDS_CI) $(DEPENDS_CI): Makefile $(PIP) install pep8 pep257 nose coverage touch $(DEPENDS_CI) # flag to indicate dependencies are installed .PHONY: .depends-dev -.depends-dev: .virtualenv Makefile $(DEPENDS_DEV) +.depends-dev: env Makefile $(DEPENDS_DEV) $(DEPENDS_DEV): Makefile - $(PIP) install docutils pdoc pylint wheel +ifneq ($(findstring win32, $(PLATFORM)), ) + $(BIN)/easy_install http://downloads.sourceforge.net/project/pywin32/pywin32/Build%20218/pywin32-218.win32-py3.3.exe +endif + $(PIP) install docutils pdoc pylint wheel pyinstaller touch $(DEPENDS_DEV) # flag to indicate dependencies are installed # Documentation ############################################################## @@ -98,15 +101,15 @@ read: doc # Static Analysis ############################################################ .PHONY: pep8 -pep8: env .depends-ci +pep8: .depends-ci $(PEP8) $(PACKAGE) --ignore=E501 .PHONY: pep257 -pep257: env .depends-ci +pep257: .depends-ci $(PEP257) $(PACKAGE) --ignore=E501,D102 .PHONY: pylint -pylint: env .depends-dev +pylint: .depends-dev $(PYLINT) $(PACKAGE) --reports no \ --msg-template="{msg_id}:{line:3d},{column}:{msg}" \ --max-line-length=79 \ @@ -118,11 +121,11 @@ check: pep8 pep257 pylint # Testing #################################################################### .PHONY: test -test: env .depends-ci +test: .depends-ci $(NOSE) .PHONY: tests -tests: env .depends-ci +tests: .depends-ci TEST_INTEGRATION=1 $(NOSE) --verbose --stop --cover-package=$(PACKAGE) .PHONY: ci @@ -172,22 +175,18 @@ clean-all: clean .clean-env fi; .PHONY: dist -dist: .git-no-changes env depends check test tests doc +dist: .git-no-changes depends check test tests doc $(PYTHON) setup.py sdist $(PYTHON) setup.py bdist_wheel $(MAKE) read .PHONY: upload -upload: .git-no-changes env depends doc +upload: .git-no-changes depends doc $(PYTHON) setup.py register sdist upload $(PYTHON) setup.py bdist_wheel upload .PHONY: exe -exe: env depends doc -ifneq ($(findstring win32, $(PLATFORM)), ) - $(BIN)/easy_install http://downloads.sourceforge.net/project/pywin32/pywin32/Build%20218/pywin32-218.win32-py3.3.exe -endif - $(PIP) install pyinstaller +exe: depends $(BIN)/pyinstaller $(PACKAGE)/main.py # System Installation ########################################################