Source: python-qrcode
Version: 5.0.1-1
Severity: wishlist
Tags: patch
User: [email protected]

Hi!

the python-qrcode source already supports Python 3 -- it would be great if
we could ship the relevant package in Debian.

Patches that do this (and a little extra tidying on the source package!) are
attached.

cheers
Stuart
>From 26a3cf34ddff43632abc758ca547793e32e03da3 Mon Sep 17 00:00:00 2001
From: Stuart Prescott <[email protected]>
Date: Fri, 17 Apr 2015 15:18:54 +1000
Subject: [PATCH 2/5] Add autopkgtest test suite

---
 debian/tests/control           | 13 +++++++++++++
 debian/tests/python-qrcode     |  9 +++++++++
 debian/tests/python3-qrcode    |  9 +++++++++
 debian/tests/python3-qrcode-qr |  7 +++++++
 4 files changed, 38 insertions(+)
 create mode 100644 debian/tests/control
 create mode 100755 debian/tests/python-qrcode
 create mode 100755 debian/tests/python3-qrcode
 create mode 100755 debian/tests/python3-qrcode-qr

diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644
index 0000000..77231bd
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,13 @@
+Tests: python-qrcode
+Depends: python-all,
+ python-qrcode
+Restrictions: allow-stderr
+
+Tests: python3-qrcode
+Depends: python3-all,
+ python3-qrcode
+Restrictions: allow-stderr
+
+Tests: python3-qrcode-qr
+Depends: python3-all,
+ python3-qrcode
diff --git a/debian/tests/python-qrcode b/debian/tests/python-qrcode
new file mode 100755
index 0000000..dc2a88f
--- /dev/null
+++ b/debian/tests/python-qrcode
@@ -0,0 +1,9 @@
+#!/bin/sh
+set -e -u
+cp -a qrcode/tests.py "$ADTTMP"
+cd "$ADTTMP"
+export PYTHONWARNINGS=d
+for py in $(pyversions -i); do
+  $py -m unittest discover -v
+done
+
diff --git a/debian/tests/python3-qrcode b/debian/tests/python3-qrcode
new file mode 100755
index 0000000..71670fe
--- /dev/null
+++ b/debian/tests/python3-qrcode
@@ -0,0 +1,9 @@
+#!/bin/sh
+set -e -u
+cp -a qrcode/tests.py "$ADTTMP"
+cd "$ADTTMP"
+export PYTHONWARNINGS=d
+for py in $(py3versions -i); do
+  $py -m unittest discover -v
+done
+
diff --git a/debian/tests/python3-qrcode-qr b/debian/tests/python3-qrcode-qr
new file mode 100755
index 0000000..993921f
--- /dev/null
+++ b/debian/tests/python3-qrcode-qr
@@ -0,0 +1,7 @@
+#!/bin/sh
+cd "$ADTTMP"
+for py in $(py3versions -i); do
+  $py /usr/bin/qr --help
+done
+
+/usr/bin/qr --help
-- 
2.1.4

>From 2c6c23ce1be5e8d711d6f64bac63a2cd44336bac Mon Sep 17 00:00:00 2001
From: Stuart Prescott <[email protected]>
Date: Fri, 17 Apr 2015 16:17:23 +1000
Subject: [PATCH 4/5] Fix d/watch and signature checking

* move to pypi.debian.net instead of chasing pypi upstream pages
* import signing key so signature can be checked
---
 debian/upstream/signing-key.asc | 30 ++++++++++++++++++++++++++++++
 debian/watch                    |  2 +-
 2 files changed, 31 insertions(+), 1 deletion(-)
 create mode 100644 debian/upstream/signing-key.asc

diff --git a/debian/upstream/signing-key.asc b/debian/upstream/signing-key.asc
new file mode 100644
index 0000000..32e4f35
--- /dev/null
+++ b/debian/upstream/signing-key.asc
@@ -0,0 +1,30 @@
+-----BEGIN PGP PUBLIC KEY BLOCK-----
+Version: GnuPG v1
+
+mQENBFDTudIBCACagG1d2hP80O3aNi+9S4rgpd1Lfa7To11XI1HsGI74jkshSxCU
+dRPc/OmPAgLjjr+iEpEZeI/h8XyCem0QOgmr2mr1nu58dJ6UvCG0yX4DvXX9SDfh
+ZeAHRzFi9tUEN4BbBf79EYfma9iqNpQPXKurvxLeHGDW48rMbT5dJd8WSN96rNEo
+OrS7EMHy3tvrU5lX4JURwHQUYmO+wXYbX5aZdvZRVG5onD1ettP3Ie87Mc/bRJ91
+6NIGXX3vlk9Gou0EpJbs6zhjvTxmjU4trjmnhUNf7+dDZpHpId5eU2sMl959qjsO
+zdQWtSgyjZ4rN8kw8MuaFqaMaBbbWnrECBAJABEBAAG0L0NocmlzIEJlYXZlbiAo
+MjAxMiBrZXkpIDxzbWlsZXlj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j17CsrCA
+FlaFQyCBhVUahbFA4pHDeNufKC/XLBZrKuYWDLD7LNSGpSIMxp7K6U0HMJH1CO8/
+tUW4fQApSM3BHnFYe2vFPq98BhbeyETFde5R2TvYg2s4nMo04qwS8nn+/lRSQQ==
+=qYc8
+-----END PGP PUBLIC KEY BLOCK-----
diff --git a/debian/watch b/debian/watch
index 008e261..8efaad1 100644
--- a/debian/watch
+++ b/debian/watch
@@ -1,2 +1,2 @@
 version=3
-opts=pgpsigurlmangle=s/$/.asc/ https://pypi.python.org/packages/source/q/qrcode/qrcode-(.*).tar.gz
+opts=pgpsigurlmangle=s/$/.asc/ http://pypi.debian.net/qrcode/qrcode-(.*).tar.gz
-- 
2.1.4

>From 788a071293a0d34cf471ed611d796ccdcc82fdd3 Mon Sep 17 00:00:00 2001
From: Stuart Prescott <[email protected]>
Date: Fri, 17 Apr 2015 15:27:09 +1000
Subject: [PATCH 3/5] Remove old boilerplate from d/rules

---
 debian/rules | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/debian/rules b/debian/rules
index c113836..3f07189 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,12 +1,5 @@
 #!/usr/bin/make -f
 
-# This file was automatically generated by stdeb 0.6.0 at
-# Thu, 14 Feb 2013 12:21:19 +0100
-
-#exports specified using stdeb Setup-Env-Vars:
-#export DH_OPTIONS=--buildsystem=python_distutils
-
-
 %:
 	dh $@ --with python2,python3 --buildsystem pybuild
 
-- 
2.1.4

>From 2e7460a4aa3f2db8e3772ae2fbbaf611a62f59bf Mon Sep 17 00:00:00 2001
From: Stuart Prescott <[email protected]>
Date: Fri, 17 Apr 2015 15:15:59 +1000
Subject: [PATCH 1/5] Add Python 3 package

* add build-deps and binary package to d/control
* add debhelper config files to make multiple binary packages
* use pybuild buildsystem and dh_python3 in d/rules
---
 debian/control                 | 39 +++++++++++++++++++++++++++++++--------
 debian/python-qrcode.install   |  1 +
 debian/python3-qrcode.docs     |  1 +
 debian/python3-qrcode.install  |  2 ++
 debian/python3-qrcode.manpages |  1 +
 debian/rules                   |  4 +++-
 6 files changed, 39 insertions(+), 9 deletions(-)
 create mode 100644 debian/python-qrcode.install
 create mode 100644 debian/python3-qrcode.docs
 create mode 100644 debian/python3-qrcode.install
 create mode 100644 debian/python3-qrcode.manpages

diff --git a/debian/control b/debian/control
index bc180d2..e6c49f9 100644
--- a/debian/control
+++ b/debian/control
@@ -6,8 +6,14 @@ Section: python
 Priority: optional
 Build-Depends: debhelper (>= 7.0.50~),
                dh-python,
-               python (>= 2.6.6-3~),
-               python-setuptools
+               python-all (>= 2.6.6-3~),
+               python3-all,
+               python-pil,
+               python3-pil,
+               python-setuptools,
+               python3-setuptools,
+               python-six,
+               python3-six,
 Standards-Version: 3.9.6
 XS-Python-Version: >= 2.6
 Homepage: http://pypi.python.org/pypi/qrcode/
@@ -18,14 +24,31 @@ Package: python-qrcode
 Architecture: all
 Depends: ${misc:Depends},
          ${python:Depends},
-         python-imaging,
+         python-pil,
          python-six
-Description: QR Code image generator library for Python
- This package provides a pure Python QR Code generator module. It uses 
+Description: QR Code image generator library for Python (Python 2 version)
+ This package provides a pure Python QR Code generator module. It uses
  the Python Imaging Library (PIL) to allow for the generation of QR Codes.
  In contrast to the python-qrencode module this module does not need
  an additional C library.
- .  
- In addition this package provides a command line tool to generate QR
- codes and either write these QR codes to a file or do the output
+ .
+ This package contains the Python 2 module; the command line tools are in
+ the python3-qrcode package.
+
+Package: python3-qrcode
+Architecture: all
+Depends: ${misc:Depends},
+         ${python3:Depends},
+         python3-pil,
+         python3-six
+Replaces: python-qrcode (<= 5.0.1-1)
+Breaks: python-qrcode (<= 5.0.1-1)
+Description: QR Code image generator library for Python (Python 3 version)
+ This package provides a pure Python QR Code generator module. It uses
+ the Python Imaging Library (PIL) to allow for the generation of QR Codes.
+ In contrast to the python-qrencode module this module does not need
+ an additional C library.
+ .
+ This package contains the Python 3 module along with a command line tool to
+ generate QR codes and either write these QR codes to a file or do the output
  as ascii art at the console.
diff --git a/debian/python-qrcode.install b/debian/python-qrcode.install
new file mode 100644
index 0000000..b2cc136
--- /dev/null
+++ b/debian/python-qrcode.install
@@ -0,0 +1 @@
+usr/lib/python2*
diff --git a/debian/python3-qrcode.docs b/debian/python3-qrcode.docs
new file mode 100644
index 0000000..a1320b1
--- /dev/null
+++ b/debian/python3-qrcode.docs
@@ -0,0 +1 @@
+README.rst
diff --git a/debian/python3-qrcode.install b/debian/python3-qrcode.install
new file mode 100644
index 0000000..2cc7165
--- /dev/null
+++ b/debian/python3-qrcode.install
@@ -0,0 +1,2 @@
+usr/lib/python3*
+usr/bin/qr
diff --git a/debian/python3-qrcode.manpages b/debian/python3-qrcode.manpages
new file mode 100644
index 0000000..3828b61
--- /dev/null
+++ b/debian/python3-qrcode.manpages
@@ -0,0 +1 @@
+doc/qr.1
diff --git a/debian/rules b/debian/rules
index 06bd563..c113836 100755
--- a/debian/rules
+++ b/debian/rules
@@ -8,8 +8,10 @@
 
 
 %:
-	dh --with python2 $@
+	dh $@ --with python2,python3 --buildsystem pybuild
 
 override_dh_installchangelogs:
 	dh_installchangelogs CHANGES.rst 
 
+override_dh_python3:
+	dh_python3 --shebang='/usr/bin/python3'
-- 
2.1.4

>From 8999294c9861e339a46c402f00eba9ab8904ebea Mon Sep 17 00:00:00 2001
From: Stuart Prescott <[email protected]>
Date: Fri, 17 Apr 2015 15:19:07 +1000
Subject: [PATCH 5/5] Add changelog entry

---
 debian/changelog | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index f41ccac..91abfd0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,13 @@
+python-qrcode (5.0.1-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Add python3-qrcode binary package.
+  * Move command line tools into python3-qrcode package.
+  * Add autopkgtest test suite.
+  * Fix d/watch to correctly check signature.
+
+ -- Stuart Prescott <[email protected]>  Mon, 13 Apr 2015 00:42:46 +1000
+
 python-qrcode (5.0.1-1) unstable; urgency=medium
 
   * Team upload.
-- 
2.1.4

Reply via email to