[reprotest] 01/01: Make tox tests work without hitting the network

Ximin Luo infinity0 at debian.org
Fri Sep 23 12:46:27 UTC 2016


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch master
in repository reprotest.

commit 97f182fecab4ecf5748d68e6d6e50f28bc506e35
Author: Ximin Luo <infinity0 at debian.org>
Date:   Fri Sep 23 14:46:06 2016 +0200

    Make tox tests work without hitting the network
    
    The patch from #838663 is also required for this to work
---
 debian/control                      |  3 +++
 debian/patches/series               |  1 +
 debian/patches/tox-no-network.patch | 17 +++++++++++++++++
 debian/python-venv-nonet            |  7 +++++++
 debian/rules                        |  4 ++--
 5 files changed, 30 insertions(+), 2 deletions(-)

diff --git a/debian/control b/debian/control
index f69f746..586498c 100644
--- a/debian/control
+++ b/debian/control
@@ -13,7 +13,10 @@ Build-Depends: debhelper (>= 9),
 # test this variation as well
  disorderfs <!nocheck>,
  python3-coverage <!nocheck>,
+ python3-pip <!nocheck>,
+ python3-pkg-resources <!nocheck>,
  python3-pytest <!nocheck>,
+ python3-wheel <!nocheck>,
  tox <!nocheck>
 Vcs-Git: https://anonscm.debian.org/git/reproducible/reprotest.git
 Vcs-Browser: https://anonscm.debian.org/git/reproducible/reprotest.git
diff --git a/debian/patches/series b/debian/patches/series
index 09352c6..fd7005c 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 debian-binname-coverage.patch
+tox-no-network.patch
diff --git a/debian/patches/tox-no-network.patch b/debian/patches/tox-no-network.patch
new file mode 100644
index 0000000..71694e2
--- /dev/null
+++ b/debian/patches/tox-no-network.patch
@@ -0,0 +1,17 @@
+Description: Make tox tests work without hitting the network
+ The patch from #838663 is also required for this to work
+Author: Ximin Luo <infinity0 at debian.org>
+Forwarded: not-needed
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/tox.ini
++++ b/tox.ini
+@@ -16,6 +16,8 @@
+ 
+ [testenv]
+ passenv = REPROTEST_TEST_SERVERS
++install_command = python3 -m pip install --no-index {opts} {packages}
++basepython = python-venv-nonet
+ # usedevelop = True
+ deps =
+   coverage
diff --git a/debian/python-venv-nonet b/debian/python-venv-nonet
new file mode 100755
index 0000000..c29888a
--- /dev/null
+++ b/debian/python-venv-nonet
@@ -0,0 +1,7 @@
+#!/bin/sh
+# Intercept tox's calls to "virtualenv" and pass it no-network options.
+if [ "$1" = "-m" -a "$2" = "virtualenv" -o "$(basename "$1")" = "virtualenv.py" ]; then
+	exec python3 "$@" --no-download --no-pip --no-setuptools --no-wheel
+else
+	exec python3 "$@"
+fi
diff --git a/debian/rules b/debian/rules
index 3e5aeec..2d433f0 100755
--- a/debian/rules
+++ b/debian/rules
@@ -8,6 +8,6 @@ export PYBUILD_NAME = reprotest
 
 override_dh_auto_test:
 ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
-# FIXME: doesn't work on pbuilder atm, tox wants network even with --sitepackages for some reason >:[
-	REPROTEST_TEST_SERVERS=null tox -r --sitepackages -- -s
+# FIXME: The patch from #838663 is also required for this to work on pbuilder
+	REPROTEST_TEST_SERVERS=null PATH=$$PWD/debian:$$PATH tox -r --sitepackages -- -s
 endif

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/reprotest.git



More information about the Reproducible-commits mailing list