From cbc5feccf81a83528599927a9c103a4ae4e25279 Mon Sep 17 00:00:00 2001 From: Julian Taylor Date: Sun, 2 Jun 2013 01:26:12 +0200 Subject: [PATCH] add python3 packages --- debian/changelog | 3 +- debian/compat | 2 +- debian/control | 42 ++++++++++++++++++++++-- debian/python-skimage-lib.install | 2 ++ debian/python-skimage.install | 1 + debian/python3-skimage-lib.install | 2 ++ debian/python3-skimage.install | 1 + debian/rules | 51 +++++++++++++++--------------- debian/tests/control | 3 ++ debian/tests/python2 | 16 +++++++--- debian/tests/python3 | 19 +++++++++++ 11 files changed, 108 insertions(+), 34 deletions(-) create mode 100755 debian/python-skimage-lib.install create mode 100644 debian/python-skimage.install create mode 100755 debian/python3-skimage-lib.install create mode 100644 debian/python3-skimage.install create mode 100755 debian/tests/python3 diff --git a/debian/changelog b/debian/changelog index 9094c60a..05f80baa 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,12 +1,13 @@ skimage (0.8.2-2) UNRELEASED; urgency=low + * add python 3 packages * add autopkgtests * update packaging to use dh_sphinxdoc and dh_python2 requires search-html.patch to fix file so dh_sphinxdoc recognises it * fix-doc-links.patch: fix navbar links in documentation * wrap-and-sort debian/ - -- Julian Taylor Mon, 10 Jun 2013 21:19:18 +0200 + -- Julian Taylor Mon, 10 Jun 2013 21:20:18 +0200 skimage (0.8.2-1) unstable; urgency=low diff --git a/debian/compat b/debian/compat index 7f8f011e..ec635144 100644 --- a/debian/compat +++ b/debian/compat @@ -1 +1 @@ -7 +9 diff --git a/debian/control b/debian/control index f95429df..cb12f4e2 100644 --- a/debian/control +++ b/debian/control @@ -4,7 +4,8 @@ Priority: optional Maintainer: Stefan van der Walt Uploaders: Yaroslav Halchenko Build-Depends: cython (>= 0.15), - debhelper (>= 7.0.50), + cython3 (>= 0.15), + debhelper (>= 9~), libfreeimage3, python-all-dev (>= 2.6.6-3~), python-imaging, @@ -13,9 +14,15 @@ Build-Depends: cython (>= 0.15), python-numpy, python-scipy (>= 0.10), python-setuptools, - python-sphinx (>= 1.0.7+dfsg-1~) + python-sphinx (>= 1.0.7+dfsg-1~), + python3-all-dev, + python3-imaging, + python3-nose, + python3-numpy, + python3-setuptools Standards-Version: 3.9.4 X-Python-Version: >= 2.6 +X-Python3-Version: >= 3.2 Homepage: http://scikits-image.org Vcs-Browser: https://github.com/scikits-image/scikits-image Vcs-Git: git://github.com/scikits-image/scikits-image.git @@ -35,6 +42,25 @@ Description: Python modules for image processing scikits-image is a collection of image processing algorithms for Python. It performs tasks such as image loading, filtering, morphology, segmentation, color conversions, and transformations. + . + This package provides the Python 2 module. + +Package: python3-skimage +Architecture: all +Depends: libfreeimage3, + python3-numpy, + python3-scipy (>= 0.10), + python3-skimage-lib (>= ${source:Version}), + ${misc:Depends}, + ${python3:Depends} +Recommends: python3-imaging, python3-matplotlib (>= 1.0), python3-nose +Suggests: python-skimage-doc +Description: Python 3 modules for image processing + scikits-image is a collection of image processing algorithms for + Python. It performs tasks such as image loading, filtering, + morphology, segmentation, color conversions, and transformations. + . + This package provides the Python 3 module. Package: python-skimage-doc Architecture: all @@ -52,3 +78,15 @@ Recommends: python-skimage Description: Optimized low-level algorithms for scikits-image This is an add-on package for python-skimage. It provides optimized, low-level implementations of algorithms. + . + This package provides the Python 2 libraries. + +Package: python3-skimage-lib +Architecture: any +Depends: python3-numpy, ${misc:Depends}, ${python3:Depends}, ${shlibs:Depends} +Recommends: python3-skimage +Description: Optimized low-level algorithms for Python 3 scikits-image + This is an add-on package for python-skimage. It provides + optimized, low-level implementations of algorithms. + . + This package provides the Python 3 libraries. diff --git a/debian/python-skimage-lib.install b/debian/python-skimage-lib.install new file mode 100755 index 00000000..b309a19f --- /dev/null +++ b/debian/python-skimage-lib.install @@ -0,0 +1,2 @@ +#!/bin/sh +find debian/tmp/usr/lib/python2* -name "*.so" diff --git a/debian/python-skimage.install b/debian/python-skimage.install new file mode 100644 index 00000000..4c0c522c --- /dev/null +++ b/debian/python-skimage.install @@ -0,0 +1 @@ +usr/lib/python2*/ diff --git a/debian/python3-skimage-lib.install b/debian/python3-skimage-lib.install new file mode 100755 index 00000000..9dd685ba --- /dev/null +++ b/debian/python3-skimage-lib.install @@ -0,0 +1,2 @@ +#!/bin/sh +find debian/tmp/usr/lib/python3* -name "*.so" diff --git a/debian/python3-skimage.install b/debian/python3-skimage.install new file mode 100644 index 00000000..eae3930a --- /dev/null +++ b/debian/python3-skimage.install @@ -0,0 +1 @@ +usr/lib/python3/ diff --git a/debian/rules b/debian/rules index b7beac2f..f4ded1d2 100755 --- a/debian/rules +++ b/debian/rules @@ -1,20 +1,23 @@ #!/usr/bin/make -f # -*- mode: makefile; coding: utf-8 -*- -PACKAGE_NAME = python-skimage -PACKAGE_ROOT_DIR = $(CURDIR)/debian/${PACKAGE_NAME} +PACKAGE2_NAME = python-skimage +PACKAGE3_NAME = python3-skimage +PKG_TMP = $(CURDIR)/debian/tmp PYVERS = $(shell pyversions -vr) PYVER = $(shell pyversions -vd) +PY3VERS = $(shell py3versions -vr) export MPLCONFIGDIR=$(CURDIR)/build export HOME=$(CURDIR)/build # Mega rule %: - dh $@ --with python2,sphinxdoc --buildsystem python_distutils + dh $@ --with python2,python3,sphinxdoc --buildsystem python_distutils override_dh_clean: + rm -f install-stamp ifeq (,$(filter noclean,$(DEB_BUILD_OPTIONS))) rm -rf build doc/build doc/auto_examples *-stamp skimage.egg-info dh_clean @@ -27,38 +30,34 @@ override_dh_auto_configure: dh_auto_configure # Build docs during install -override_dh_auto_install: ${PYVERS:%=python-install%} +override_dh_auto_install: ${PYVERS:%=python-install%} ${PY3VERS:%=python-install%} + : # Build Documentation +ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS))) + export PYTHONPATH=$(PKG_TMP)/usr/lib/python$(PYVER)/dist-packages; \ + cd doc; test -d build/html || $(MAKE) html +endif + touch install-stamp # Per Python version logic -- install, test, move .so into -lib python-install%: - python$* setup.py install --install-layout=deb --root=$(PACKAGE_ROOT_DIR) - - : # Build Documentation -ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS))) - export PYTHONPATH=$(PACKAGE_ROOT_DIR)/usr/lib/python$*/dist-packages; \ - cd doc; test -d build/html || $(MAKE) html - python$* setup.py install --install-layout=deb --root=$(PACKAGE_ROOT_DIR) -endif + python$* setup.py install --install-layout=deb --root=$(CURDIR)/debian/tmp +python-test%: install-stamp ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) - : # Run unittests - export PYTHONPATH=$(PACKAGE_ROOT_DIR)/usr/lib/python$*/dist-packages; \ - python$* /usr/bin/nosetests -s \ - $(PACKAGE_ROOT_DIR)/usr/lib/python$*/*-packages/skimage + pkgbuild=yes debian/tests/python$* else - : # Skip unittests due to nocheck + : # Skip unittests due to nocheck endif - : # Move platform-specific libraries into -lib - set -e; for lib in $$(find $(PACKAGE_ROOT_DIR)/usr -name '*.so'); do \ - sdir=$$(dirname $$lib) ; \ - tdir=$(PACKAGE_ROOT_DIR)-lib/$${sdir#*$(PACKAGE_NAME)/} ; \ - mkdir -p $$tdir ; \ - echo "Moving '$$lib' into '$$tdir'." ; \ - mv $$lib $$tdir ; \ - done +## remove .so libraries from main package, and call dh_numpy* +_dh_python%: python-test% + find debian/$(PACKAGE$*_NAME)/usr/lib -name "*.so" -delete; - if [ -x /usr/bin/dh_numpy ]; then dh_numpy; fi + dh_numpy$(*:2=) -p$(PACKAGE$*_NAME)-lib + dh_python$* + +override_dh_python2: _dh_python2 +override_dh_python3: _dh_python3 ## immediately useable documentation and exemplar scripts/data override_dh_compress: diff --git a/debian/tests/control b/debian/tests/control index 61e2baaa..de4b2bd5 100644 --- a/debian/tests/control +++ b/debian/tests/control @@ -1,2 +1,5 @@ Tests: python2 Depends: python-all, python-nose, python-skimage + +Tests: python3 +Depends: python3-all, python3-nose, python3-skimage diff --git a/debian/tests/python2 b/debian/tests/python2 index c0963884..7f6d47c1 100755 --- a/debian/tests/python2 +++ b/debian/tests/python2 @@ -1,11 +1,19 @@ #!/bin/sh set -efu -pys="$(pyversions -r 2>/dev/null)" +pys="$(pyversions -rv 2>/dev/null)" +pkgbuild=${pkgbuild:-no} -cd "$ADTTMP" +srcdir=$PWD for py in $pys; do - echo "=== $py ===" - $py /usr/bin/nosetests -v skimage 2>&1 + echo "=== python$py ===" + if [ "$pkgbuild" = "yes" ]; then + export PYTHONPATH="$srcdir/debian/tmp/usr/lib/python$py/dist-packages" + cd "$srcdir/build/" + else + cd "$ADTTMP" + fi + + python$py /usr/bin/nosetests -s -v skimage 2>&1 done diff --git a/debian/tests/python3 b/debian/tests/python3 new file mode 100755 index 00000000..d6d6abf5 --- /dev/null +++ b/debian/tests/python3 @@ -0,0 +1,19 @@ +#!/bin/sh +set -efu + +pys="$(py3versions -rv 2>/dev/null)" +pkgbuild=${pkgbuild:-no} + +srcdir=$PWD + +for py in $pys; do + echo "=== python$py ===" + if [ "$pkgbuild" = "yes" ]; then + export PYTHONPATH="$srcdir/debian/tmp/usr/lib/python3/dist-packages" + cd "$srcdir/build/" + else + cd "$ADTTMP" + fi + + python$py /usr/bin/nosetests3 -s -v skimage 2>&1 +done