From 824e449a48cefb81ed3becdc392c51f66e27f9bd Mon Sep 17 00:00:00 2001
From: Stefano Rivera <stefanor@debian.org>
Date: Fri, 5 Aug 2022 13:53:49 +0200
Subject: [PATCH] Drop Build-Depends on python2. (Closes: #1016681)

---
 debian/changelog                   |  7 +++++++
 debian/control                     |  1 -
 debian/patches/series              |  1 +
 debian/patches/skip-python2.7-test | 25 +++++++++++++++++++++++++
 debian/tests/control               |  2 +-
 5 files changed, 34 insertions(+), 2 deletions(-)
 create mode 100644 debian/patches/skip-python2.7-test

diff --git a/debian/changelog b/debian/changelog
index 8539955..8cfe3dd 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+python-mitogen (0.3.3-2) UNRELEASED; urgency=medium
+
+  * Drop Build-Depends on python2. (Closes: #1016681)
+    - Patch: Stop the (trivial) testing against python2.7.
+
+ -- Stefano Rivera <stefanor@debian.org>  Fri, 05 Aug 2022 13:53:05 +0200
+
 python-mitogen (0.3.3-1) unstable; urgency=medium
 
   * New upstream release.
diff --git a/debian/control b/debian/control
index ca44f5c..e986962 100644
--- a/debian/control
+++ b/debian/control
@@ -10,7 +10,6 @@ Uploaders:
 Build-Depends:
  debhelper-compat (= 13),
  dh-python,
- python2,
  python3-all,
  python3-mock,
  python3-psutil,
diff --git a/debian/patches/series b/debian/patches/series
index d5dd401..afc9d3e 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,4 @@ python3
 skip-ppc64el-test_broken_linux_fallback
 skip-failing-tests
 skip-django-tests
+skip-python2.7-test
diff --git a/debian/patches/skip-python2.7-test b/debian/patches/skip-python2.7-test
new file mode 100644
index 0000000..017bc70
--- /dev/null
+++ b/debian/patches/skip-python2.7-test
@@ -0,0 +1,25 @@
+From: Stefano Rivera <stefanor@debian.org>
+Date: Fri, 5 Aug 2022 17:02:10 +0200
+Subject: Skip two_three_compat_test, requires python2.7
+
+Debian is removing python2.7 from the archive, skip tests that require
+it.
+
+Bug-Debian: https://bugs.debian.org/1016681
+Forwarded: no
+---
+ tests/two_three_compat_test.py | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/tests/two_three_compat_test.py b/tests/two_three_compat_test.py
+index 4490e5d..723b96b 100644
+--- a/tests/two_three_compat_test.py
++++ b/tests/two_three_compat_test.py
+@@ -13,6 +13,7 @@ class TwoThreeCompatTest(testlib.RouterMixin, testlib.TestCase):
+     else:
+         python_path = 'python3'
+ 
++    @testlib.unittest.skip("Requires Python 2.7, no longer available")
+     def test_succeeds(self):
+         spare = self.router.local()
+         target = self.router.local(python_path=self.python_path)
diff --git a/debian/tests/control b/debian/tests/control
index 6aac5b4..8617e28 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -3,5 +3,5 @@ Depends: ansible-mitogen, python3-mock, python3-psutil
 Restrictions: allow-stderr, needs-root
 
 Tests: mitogen-tests
-Depends: python2, python3-mitogen, python3-mock, python3-psutil
+Depends: python3-mitogen, python3-mock, python3-psutil
 Restrictions: allow-stderr
-- 
GitLab