[Python-modules-commits] [pytest] 09/10: Update the packaging to pybuild.
Barry Warsaw
barry at moszumanska.debian.org
Thu Dec 17 00:08:03 UTC 2015
This is an automated email from the git hooks/post-receive script.
barry pushed a commit to branch master
in repository pytest.
commit c6eb0d1da9bdf2a0cfb40d69711e8a88e86d4657
Author: Barry Warsaw <barry at python.org>
Date: Wed Dec 16 16:11:28 2015 -0500
Update the packaging to pybuild.
* d/patches/local-intersphinx: Removed; no longer necessary.
* d/rules:
- Convert to --buildsystem=pybuild
- override_dh_auto_test: Disable since the unittests can't be run
during package build time.
- override_dh_installdocs: Added.
* debian/py.test.template: Removed.
* d/*.install, *.postinst, *.prerm, *.rtinstall, *.rtremove: Removed.
---
debian/changelog | 9 +++-
debian/control | 52 ++++++++++----------
debian/py.test.template | 5 --
debian/python-pytest.install | 1 -
debian/python-pytest.postinst | 38 ---------------
debian/python-pytest.prerm | 29 ------------
debian/python-pytest.rtinstall | 7 ---
debian/python-pytest.rtremove | 3 --
debian/python3-pytest.install | 1 -
debian/python3-pytest.postinst | 39 ---------------
debian/python3-pytest.prerm | 29 ------------
debian/python3-pytest.rtinstall | 7 ---
debian/python3-pytest.rtremove | 3 --
debian/rules | 102 ++++++++++++++++++++++------------------
debian/tests/control | 3 ++
15 files changed, 93 insertions(+), 235 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 935e1da..bdcb20d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,7 +1,14 @@
pytest (2.8.5-1) UNRELEASED; urgency=medium
* New upstream release.
- * debian/patches/local-intersphinx: Removed; no longer necessary.
+ * d/patches/local-intersphinx: Removed; no longer necessary.
+ * d/rules:
+ - Convert to --buildsystem=pybuild
+ - override_dh_auto_test: Disable since the unittests can't be run
+ during package build time.
+ - override_dh_installdocs: Added.
+ * debian/py.test.template: Removed.
+ * d/*.install, *.postinst, *.prerm, *.rtinstall, *.rtremove: Removed.
-- Barry Warsaw <barry at debian.org> Mon, 14 Dec 2015 10:13:32 -0500
diff --git a/debian/control b/debian/control
index 742dc6c..d004745 100644
--- a/debian/control
+++ b/debian/control
@@ -3,23 +3,23 @@ Section: python
Priority: optional
Maintainer: Debian Python Modules Team <python-modules-team at lists.alioth.debian.org>
Uploaders: Simon Chopin <chopin.simon at gmail.com>
-Build-Depends:
- debhelper (>= 9),
- dh-python,
- python-all (>= 2.6.6-3~),
- python-py (>= 1.4.29),
- python-twisted-core,
- python-pexpect,
- python-nose,
- python-mock (>= 1.0.1),
- python-setuptools,
- python-sphinx (>= 1.0.7+dfsg),
- python3-all (>= 3.1.2-6~),
- python3-py (>= 1.4.29),
- python3-nose,
- python3-mock (>= 1.0.1),
- python3-setuptools,
- python-doc
+Build-Depends: debhelper (>= 9),
+ dh-python,
+ python-all (>= 2.6.6-3~),
+ python-doc,
+ python-mock (>= 1.0.1),
+ python-nose,
+ python-pexpect,
+ python-py (>= 1.4.29),
+ python-setuptools,
+ python-sphinx (>= 1.0.7+dfsg),
+ python-twisted-core,
+ python3-all (>= 3.1.2-6~),
+ python3-mock (>= 1.0.1),
+ python3-nose,
+ python3-py (>= 1.4.29),
+ python3-setuptools,
+ tox
Build-Conflicts: python-pytest-xdist (<< 1.5)
X-Python-Version: >= 2.4
X-Python3-Version: >= 3.0
@@ -31,11 +31,10 @@ XS-Testsuite: autopkgtest
Package: python-pytest
Architecture: all
-Depends:
- python-pkg-resources,
- python-py (>= 1.4.29),
- ${misc:Depends},
- ${python:Depends}
+Depends: python-pkg-resources,
+ python-py (>= 1.4.29),
+ ${misc:Depends},
+ ${python:Depends}
Suggests: python-mock (>= 1.0.1)
Description: Simple, powerful testing in Python
This testing tool has for objective to allow the developers to limit the
@@ -44,11 +43,10 @@ Description: Simple, powerful testing in Python
Package: python3-pytest
Architecture: all
-Depends:
- python3-pkg-resources,
- python3-py (>= 1.4.29),
- ${misc:Depends},
- ${python3:Depends}
+Depends: python3-pkg-resources,
+ python3-py (>= 1.4.29),
+ ${misc:Depends},
+ ${python3:Depends}
Description: Simple, powerful testing in Python3
This testing tool has for objective to allow the developers to limit the
boilerplate code around the tests, promoting the use of built-in
diff --git a/debian/py.test.template b/debian/py.test.template
deleted file mode 100644
index 5079469..0000000
--- a/debian/py.test.template
+++ /dev/null
@@ -1,5 +0,0 @@
-#PYSHEBANG#
-
-import sys
-from pkg_resources import load_entry_point
-sys.exit(load_entry_point('pytest==#UPSTREAMVERSION#', 'console_scripts', 'py.test')())
diff --git a/debian/python-pytest.install b/debian/python-pytest.install
deleted file mode 100644
index faa0b85..0000000
--- a/debian/python-pytest.install
+++ /dev/null
@@ -1 +0,0 @@
-debian/python-pytest.rt* /usr/share/python/runtime.d
diff --git a/debian/python-pytest.postinst b/debian/python-pytest.postinst
deleted file mode 100644
index 8de17b4..0000000
--- a/debian/python-pytest.postinst
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/bin/sh
-set -e
-
-# summary of how this script can be called:
-# * <postinst> `configure' <most-recently-configured-version>
-# * <old-postinst> `abort-upgrade' <new version>
-# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
-# <new-version>
-# * <postinst> `abort-remove'
-# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
-# <failed-install-package> <version> `removing'
-# <conflicting-package> <version>
-# for details, see http://www.debian.org/doc/debian-policy/ or
-# the debian-policy package
-
-
-case "$1" in
- configure|abort-upgrade|abort-remove|abort-deconfigure)
- for version in `pyversions -vi`; do
- if [ $version ]; then
- cp /usr/bin/py.test /usr/bin/py.test-$version
- sed -i "s,#! */usr/bin/python,#!/usr/bin/python$version," "/usr/bin/py.test-$version"
- fi
- done
- ;;
-
- *)
- echo "postinst called with unknown argument \`$1'" >&2
- exit 1
- ;;
-esac
-
-# dh_installdeb will replace this with shell code automatically
-# generated by other debhelper scripts.
-
-#DEBHELPER#
-
-exit 0
diff --git a/debian/python-pytest.prerm b/debian/python-pytest.prerm
deleted file mode 100644
index 628c0c5..0000000
--- a/debian/python-pytest.prerm
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/sh
-set -e
-
-# summary of how this script can be called:
-# * <prerm> `remove'
-# * <old-prerm> `upgrade' <new-version>
-# * <new-prerm> `failed-upgrade' <old-version>
-# * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
-# * <deconfigured's-prerm> `deconfigure' `in-favour'
-# <package-being-installed> <version> `removing'
-# <conflicting-package> <version>
-
-case "$1" in
- remove|upgrade|deconfigure|failed-upgrade)
- rm -f /usr/bin/py.test-2.[0-9]
- ;;
-
- *)
- echo "prerm called with unknown argument \`$1'" >&2
- exit 1
- ;;
-esac
-
-# dh_installdeb will replace this with shell code automatically
-# generated by other debhelper scripts.
-
-#DEBHELPER#
-
-exit 0
diff --git a/debian/python-pytest.rtinstall b/debian/python-pytest.rtinstall
deleted file mode 100755
index aad35bf..0000000
--- a/debian/python-pytest.rtinstall
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-set -e
-PYVERSION="${2##*python}"
-if [ ! -e "/usr/bin/py.test-$PYVERSION" ]; then
- cp /usr/bin/py.test /usr/bin/py.test-$PYVERSION
- sed -i "s,#! */usr/bin/python,#!/usr/bin/$2," /usr/bin/py.test-$PYVERSION
-fi
diff --git a/debian/python-pytest.rtremove b/debian/python-pytest.rtremove
deleted file mode 100755
index 656e1ce..0000000
--- a/debian/python-pytest.rtremove
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-set -e
-rm -f "/usr/bin/py.test-${2##*python}"
diff --git a/debian/python3-pytest.install b/debian/python3-pytest.install
deleted file mode 100644
index b803aa1..0000000
--- a/debian/python3-pytest.install
+++ /dev/null
@@ -1 +0,0 @@
-debian/python3-pytest.rt* /usr/share/python3/runtime.d
diff --git a/debian/python3-pytest.postinst b/debian/python3-pytest.postinst
deleted file mode 100644
index 6e6f726..0000000
--- a/debian/python3-pytest.postinst
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/bin/sh
-set -e
-
-# summary of how this script can be called:
-# * <postinst> `configure' <most-recently-configured-version>
-# * <old-postinst> `abort-upgrade' <new version>
-# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
-# <new-version>
-# * <postinst> `abort-remove'
-# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
-# <failed-install-package> <version> `removing'
-# <conflicting-package> <version>
-# for details, see http://www.debian.org/doc/debian-policy/ or
-# the debian-policy package
-
-
-case "$1" in
- configure|abort-upgrade|abort-remove|abort-deconfigure)
- # Just in case, recreate all scripts
- for version in `py3versions -vi`; do
- if [ $version ]; then
- cp /usr/bin/py.test-3 /usr/bin/py.test-$version
- sed -i "s,#! */usr/bin/python3,#!/usr/bin/python$version," "/usr/bin/py.test-$version"
- fi
- done
- ;;
-
- *)
- echo "postinst called with unknown argument \`$1'" >&2
- exit 1
- ;;
-esac
-
-# dh_installdeb will replace this with shell code automatically
-# generated by other debhelper scripts.
-
-#DEBHELPER#
-
-exit 0
diff --git a/debian/python3-pytest.prerm b/debian/python3-pytest.prerm
deleted file mode 100644
index d354019..0000000
--- a/debian/python3-pytest.prerm
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/sh
-set -e
-
-# summary of how this script can be called:
-# * <prerm> `remove'
-# * <old-prerm> `upgrade' <new-version>
-# * <new-prerm> `failed-upgrade' <old-version>
-# * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
-# * <deconfigured's-prerm> `deconfigure' `in-favour'
-# <package-being-installed> <version> `removing'
-# <conflicting-package> <version>
-
-case "$1" in
- remove|upgrade|deconfigure|failed-upgrade)
- rm -f /usr/bin/py.test-3.[0-9]
- ;;
-
- *)
- echo "prerm called with unknown argument \`$1'" >&2
- exit 1
- ;;
-esac
-
-# dh_installdeb will replace this with shell code automatically
-# generated by other debhelper scripts.
-
-#DEBHELPER#
-
-exit 0
diff --git a/debian/python3-pytest.rtinstall b/debian/python3-pytest.rtinstall
deleted file mode 100755
index dbb8e66..0000000
--- a/debian/python3-pytest.rtinstall
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-set -e
-PYVERSION="${2##*python}"
-if [ ! -e "/usr/bin/py.test-$PYVERSION" ]; then
- cp /usr/bin/py.test-3 /usr/bin/py.test-$PYVERSION
- sed -i "s,#! */usr/bin/python3,#!/usr/bin/$2," /usr/bin/py.test-$PYVERSION
-fi
diff --git a/debian/python3-pytest.rtremove b/debian/python3-pytest.rtremove
deleted file mode 100755
index 656e1ce..0000000
--- a/debian/python3-pytest.rtremove
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-set -e
-rm -f "/usr/bin/py.test-${2##*python}"
diff --git a/debian/rules b/debian/rules
index f473395..45ae559 100755
--- a/debian/rules
+++ b/debian/rules
@@ -2,22 +2,26 @@
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
+export DH_VERBOSE=1
+export PYBUILD_NAME=pytest
+export PYBUILD_VERBOSE=1
+# export PYBUILD_TEST_TOX=1
+# export PYBUILD_TEST_ARGS=--sitepackages
-PYVERS := $(shell pyversions -vr)
-PY3VERS := $(shell py3versions -vr)
+# PYVERS := $(shell pyversions -vr)
+# PY3VERS := $(shell py3versions -vr)
-UPSTREAM = $(shell dpkg-parsechangelog | egrep "^Version: "| sed 's/Version: \(.*\)-.*/\1/' )
+# UPSTREAM = $(shell dpkg-parsechangelog | egrep "^Version: "| sed 's/Version: \(.*\)-.*/\1/' )
%:
- dh $@ --with python2,python3,sphinxdoc
+ dh $@ --with python2,python3,sphinxdoc --buildsystem=pybuild
-override_dh_auto_build:
- # Build for all versions.
- set -ex; \
- for py in $(PYVERS) $(PY3VERS); do \
- python$$py setup.py build; \
- done
+# The old way of running the tests doesn't work any more as of pytest 2.8.5,
+# so we can no longer run them during package build. Rely on DEP-8 to run the
+# test suite now.
+override_dh_auto_test:
+
+override_dh_installdocs:
PYTHONPATH=`pwd` make -C doc/en man
cp doc/en/_build/man/pytest.1 debian/py.test.1
cp debian/py.test.1 debian/py.test-3.1
@@ -25,42 +29,50 @@ override_dh_auto_build:
sed -i 's/PYTEST/PY.TEST-3/g' debian/py.test-3.1
sed -i 's/py\.test/py.test-3/g' debian/py.test-3.1
PYTHONPATH=`pwd` make -C doc/en/ html
+ dh_installdocs doc/en/_build/html
-override_dh_compress:
- dh_compress -X.html
+override_dh_auto_install:
+ dh_auto_install
+ mv debian/python3-pytest/usr/bin/py.test \
+ debian/python3-pytest/usr/bin/py.test-3
+ -sed -i '1s|.*|#!/usr/bin/python3.4|' \
+ debian/python3-pytest/usr/bin/py.test-3.4
+ -sed -i '1s|.*|#!/usr/bin/python3.5|' \
+ debian/python3-pytest/usr/bin/py.test-3.5
+ rm -rf debian/python3-pytest/usr/lib/python3.5
-override_dh_install:
- # Only install for the default versions.
- python setup.py install --skip-build --no-compile \
- --root debian/python-pytest \
- --install-layout=deb
- rm debian/python-pytest/usr/bin/*
- install -m 755 debian/py.test.template debian/python-pytest/usr/bin/py.test
- sed -i 's/#UPSTREAMVERSION#/$(UPSTREAM)/' debian/python-pytest/usr/bin/py.test
- sed -i 's,#PYSHEBANG#,#!/usr/bin/python,' debian/python-pytest/usr/bin/py.test
- python3 setup.py install --skip-build --no-compile \
- --root debian/python3-pytest \
- --install-layout=deb
- rm debian/python3-pytest/usr/bin/*
- install -m 755 debian/py.test.template debian/python3-pytest/usr/bin/py.test-3
- sed -i 's/#UPSTREAMVERSION#/$(UPSTREAM)/' debian/python3-pytest/usr/bin/py.test-3
- sed -i 's,#PYSHEBANG#,#!/usr/bin/python3,' debian/python3-pytest/usr/bin/py.test-3
- dh_install
+# override_dh_install:
+# # Only install for the default versions.
+# python setup.py install --skip-build --no-compile \
+# --root debian/python-pytest \
+# --install-layout=deb
+# rm debian/python-pytest/usr/bin/*
+# install -m 755 debian/py.test.template debian/python-pytest/usr/bin/py.test
+# sed -i 's/#UPSTREAMVERSION#/$(UPSTREAM)/' debian/python-pytest/usr/bin/py.test
+# sed -i 's,#PYSHEBANG#,#!/usr/bin/python,' debian/python-pytest/usr/bin/py.test
+# python3 setup.py install --skip-build --no-compile \
+# --root debian/python3-pytest \
+# --install-layout=deb
+# rm debian/python3-pytest/usr/bin/*
+# install -m 755 debian/py.test.template debian/python3-pytest/usr/bin/py.test-3
+# sed -i 's/#UPSTREAMVERSION#/$(UPSTREAM)/' debian/python3-pytest/usr/bin/py.test-3
+# sed -i 's,#PYSHEBANG#,#!/usr/bin/python3,' debian/python3-pytest/usr/bin/py.test-3
+# dh_install
-override_dh_auto_clean:
- rm -rf doc/en/_build build pytest.egg-info
- find . \( -name '*.py[oc]' -o -name __pycache__ \) -delete
- dh_auto_clean
+# override_dh_auto_clean:
+# rm -rf doc/en/_build build pytest.egg-info
+# find . \( -name '*.py[oc]' -o -name __pycache__ \) -delete
+# dh_auto_clean
-override_dh_clean:
- rm debian/py.test.1 debian/py.test-3.1 -f
- dh_clean
-
-override_dh_auto_test:
-ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
- set -ex; \
- for py in $(PYVERS) $(PY3VERS); do \
- PYTHONPATH=$(CURDIR) python$$py -m pytest testing ; \
- done
-endif
+# override_dh_clean:
+# rm debian/py.test.1 debian/py.test-3.1 -f
+# dh_clean
+# override_dh_auto_test:
+# ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
+# set -ex; \
+# export TMPDIR=`mktemp -d pytest.tmp.XXXXXXXXXX --tmpdir=$$TMPDIR`; \
+# for py in $(PYVERS) $(PY3VERS); do \
+# PYTHONPATH=$(CURDIR) python$$py -m pytest testing ; \
+# done
+# endif
diff --git a/debian/tests/control b/debian/tests/control
index 70abd2a..f6e5bf6 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -14,3 +14,6 @@ Depends:
python3-all,
python3-mock (>= 1.0.1),
python3-nose
+
+Test-Command: tox --sitepackages -e py27,py34,py35
+Depends: @, tox
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/pytest.git
More information about the Python-modules-commits
mailing list