Package: python-sure
Version: 1.2.2-2
Severity: wishlist
Tags: patch

Dear Maintainer,

I would like to add Python 3 support for my (NEW) python-smstrade package
which depends on python-httpretty. The package python-sure is a build
dependency of python-httpretty and needs Python 3 support before
python-httpretty can get this support.

The attached patch applies cleanly to the python-sure git repository and
adds Python 3 support. I used python-pbr as inspiration for the debian/rules
file to be in sync with existing OpenStack packages.


-- System Information:
Debian Release: jessie/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.12-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=de_DE.utf8, LC_CTYPE=de_DE.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages python-sure depends on:
ii  dpkg         1.17.6
ii  python       2.7.5-5
ii  python-nose  1.3.0-3

python-sure recommends no packages.

python-sure suggests no packages.

-- no debconf information


Best regards
Jan Dittberner

-- 
Jan Dittberner - Debian Developer
GPG-key: 4096R/558FB8DD 2009-05-10
         B2FF 1D95 CE8F 7A22 DF4C  F09B A73E 0055 558F B8DD
http://portfolio.debian.net/ - http://people.debian.org/~jandd/
diff --git a/debian/changelog b/debian/changelog
index 2bcb645..f54c633 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,18 @@
+python-sure (1.2.2-2.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * add Python 3 support
+  * debian/control:
+    - add new binary package python3-sure
+    - add Python 3 Build-Depends, Depends and Recommends
+  * debian/rules:
+    - add python3 to dh sequencer
+    - use nosetest3 to run tests with Python 3
+    - add override_dh_auto_build and override_dh_auto_install
+  * add debian/python3-sure.install and debian/python-sure.install
+
+ -- Jan Dittberner <ja...@debian.org>  Mon, 24 Feb 2014 17:54:31 +0100
+
 python-sure (1.2.2-2) unstable; urgency=low
 
   * Drops dependency on python-steadymark (Closes: #722507).
diff --git a/debian/control b/debian/control
index ab2f76a..9b2bbf1 100644
--- a/debian/control
+++ b/debian/control
@@ -8,7 +8,10 @@ Uploaders: Julien Danjou <a...@debian.org>,
 Build-Depends: debhelper (>= 9),
                python-all (>= 2.6.6-3~),
                python-nose,
-               python-setuptools
+               python-setuptools,
+               python3-all,
+               python3-nose,
+               python3-setuptools
 Standards-Version: 3.9.4
 Vcs-Browser: http://anonscm.debian.org/gitweb/?p=openstack/python-sure.git
 Vcs-Git: git://anonscm.debian.org/openstack/python-sure.git
@@ -24,3 +27,18 @@ Description: utility belt for automated testing for Python
  CPython it monkey-patches the object type, adding some methods and properties
  purely for test purposes. Any Python code writen after "import sure" gains
  testing superpowers.
+ .
+ This is the Python 2 version of the package.
+
+Package: python3-sure
+Architecture: all
+Pre-Depends: dpkg (>= 1.15.6~)
+Depends: python3-nose, ${misc:Depends}, ${python3:Depends}
+Recommends: ${python3:Recommends}
+Description: utility belt for automated testing for Python 3
+ Sure is a library for Python that leverages a DSL for writing assertions. In
+ CPython it monkey-patches the object type, adding some methods and properties
+ purely for test purposes. Any Python code writen after "import sure" gains
+ testing superpowers.
+ .
+ This is the Python 3 version of the package.
diff --git a/debian/python-sure.install b/debian/python-sure.install
new file mode 100644
index 0000000..b2cc136
--- /dev/null
+++ b/debian/python-sure.install
@@ -0,0 +1 @@
+usr/lib/python2*
diff --git a/debian/python3-sure.install b/debian/python3-sure.install
new file mode 100644
index 0000000..b06a399
--- /dev/null
+++ b/debian/python3-sure.install
@@ -0,0 +1 @@
+usr/lib/python3
diff --git a/debian/rules b/debian/rules
index 4fd00ba..b7cbe88 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,12 +1,23 @@
 #!/usr/bin/make -f
 
+PYTHON3:=$(shell py3versions -r)
+py3sdo=set -ex; $(foreach py, $(PYTHON3), $(py) $(1);)
 UPSTREAM_GIT = git://github.com/gabrielfalcao/sure.git
 -include /usr/share/openstack-pkg-tools/pkgos.make
 
 %:
-	dh $@ --buildsystem=python_distutils --with python2
+	dh $@ --buildsystem=python_distutils --with python2,python3
+
+override_dh_auto_build:
+	dh_auto_build
+	$(call py3sdo, setup.py build)
+
+override_dh_auto_install:
+	dh_auto_install
+	$(call py3sdo, setup.py install --root=$(CURDIR)/debian/tmp --install-layout=deb)
 
 ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
 override_dh_auto_test:
 	nosetests
+	nosetests3
 endif

Attachment: signature.asc
Description: Digital signature

Reply via email to