← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/txpkgupload:py3-alternate-python-version into txpkgupload:master

 

Colin Watson has proposed merging ~cjwatson/txpkgupload:py3-alternate-python-version into txpkgupload:master.

Commit message:
Allow building with a different Python version

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/txpkgupload/+git/txpkgupload/+merge/392781

This makes it possible to begin experimenting with a Python 3 port.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/txpkgupload:py3-alternate-python-version into txpkgupload:master.
diff --git a/Makefile b/Makefile
index 4042980..a7f506d 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,8 @@
 # Copyright 2005-2015 Canonical Ltd.  This software is licensed under the
 # GNU Affero General Public License version 3 (see the file LICENSE).
 
+PYTHON = python
+
 ENV = $(CURDIR)/env
 
 DEPENDENCY_REPO ?= lp:~lazr-developers/txpkgupload/+git/dependencies
@@ -11,7 +13,6 @@ PIP_ARGS := \
 	--no-index \
 	--find-links=file://$(DEPENDENCY_DIR)/
 
-PYTHON = $(ENV)/bin/python
 TWISTD = $(ENV)/bin/twistd
 
 VERSION_INFO = version-info.py
@@ -30,11 +31,11 @@ $(VERSION_INFO):
 
 
 check: compile
-	$(PYTHON) -m unittest discover src
+	$(ENV)/bin/python -m unittest discover src
 
 
 dist:
-	python setup.py sdist
+	$(PYTHON) setup.py sdist
 
 
 TAGS:
@@ -55,7 +56,8 @@ $(ENV): | $(DEPENDENCY_DIR)
 	 echo "allow_hosts = ''"; \
 	 echo 'find_links = file://$(DEPENDENCY_DIR)/') \
 		>$(ENV)/.pydistutils.cfg
-	VIRTUALENV_SETUPTOOLS=1 virtualenv --never-download $(ENV)
+	VIRTUALENV_SETUPTOOLS=1 virtualenv \
+		--python=$(PYTHON) --never-download $(ENV)
 	$(ENV)/bin/pip install $(PIP_ARGS) -r bootstrap-requirements.txt
 	$(ENV)/bin/pip install $(PIP_ARGS) -c requirements.txt -e '.[test]'
 	$(ENV)/bin/python -m compileall -q src