Merge ~ahasenack/ubuntu/+source/python-fysom:jammy-fix-py310-collections-import into ubuntu/+source/python-fysom:ubuntu/devel

Proposed by Andreas Hasenack
Status: Merged
Merged at revision: 805ceba9e9361d3fecaff62235deac7583a72178
Proposed branch: ~ahasenack/ubuntu/+source/python-fysom:jammy-fix-py310-collections-import
Merge into: ubuntu/+source/python-fysom:ubuntu/devel
Diff against target: 95 lines (+65/-1)
4 files modified
debian/changelog (+7/-0)
debian/control (+2/-1)
debian/patches/import_abc_from_collections_abc.patch (+55/-0)
debian/patches/series (+1/-0)
Reviewer Review Type Date Requested Status
Sergio Durigan Junior (community) Approve
Canonical Server Pending
Review via email: mp+415043@code.launchpad.net

Description of the change

Fix collections import in python 3.10

PPA: https://launchpad.net/~ahasenack/+archive/ubuntu/py310-collections (just amd64 for speed)

To test, run the dep8 test manually after installing the new package:

$ python3 debian/tests/import3
green

Submitted to debian via a bug report and salsa PR.

To post a comment you must log in.
Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

I'll take a look at this one.

Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

Thanks for the MP, Andreas. Aside from the Applied-Upstream suggestion (which is the same comment I've made on the salsa MR), everything LGTM. Package builds & tests fine locally. +1

review: Approve
Revision history for this message
Andreas Hasenack (ahasenack) :
Revision history for this message
Andreas Hasenack (ahasenack) :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/debian/changelog b/debian/changelog
index 7911bd3..668b0b7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
1python-fysom (2.1.5-3ubuntu1) jammy; urgency=medium
2
3 * d/p/import_abc_from_collections_abc.patch: Fix collections import
4 for Python 3.10+ (LP: #1959907)
5
6 -- Andreas Hasenack <andreas@canonical.com> Thu, 03 Feb 2022 14:34:40 -0300
7
1python-fysom (2.1.5-3) unstable; urgency=medium8python-fysom (2.1.5-3) unstable; urgency=medium
29
3 [ Marcin Kulisz ]10 [ Marcin Kulisz ]
diff --git a/debian/control b/debian/control
index 589f74b..8f7c1db 100644
--- a/debian/control
+++ b/debian/control
@@ -1,5 +1,6 @@
1Source: python-fysom1Source: python-fysom
2Maintainer: Marcin Kulisz <debian@kulisz.net>2Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
3XSBC-Original-Maintainer: Marcin Kulisz <debian@kulisz.net>
3Section: python4Section: python
4Priority: optional5Priority: optional
5Build-Depends: debhelper-compat (= 12),6Build-Depends: debhelper-compat (= 12),
diff --git a/debian/patches/import_abc_from_collections_abc.patch b/debian/patches/import_abc_from_collections_abc.patch
6new file mode 1006447new file mode 100644
index 0000000..4e3e461
--- /dev/null
+++ b/debian/patches/import_abc_from_collections_abc.patch
@@ -0,0 +1,55 @@
1From 1ed6950d2b683a9a2a2ab35dfd0ea79dc2963dc3 Mon Sep 17 00:00:00 2001
2From: Karthikeyan Singaravelan <tir.karthi@gmail.com>
3Date: Thu, 9 Apr 2020 14:32:14 +0000
4Subject: [PATCH] Import ABC from collections.abc instead of collections for
5 Python 3 compatibility.
6
7---
8 src/main/python/fysom/__init__.py | 10 +++++++---
9 1 file changed, 7 insertions(+), 3 deletions(-)
10
11Origin: upstream, https://github.com/mriehl/fysom/commit/1ed6950d2b683a9a2a2ab35dfd0ea79dc2963dc3
12Bug: https://bugs.debian.org/1004913
13Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/python-fysom/+bug/1959907
14Last-Update: 2022-02-03
15Applied-Upstream: 2.1.6
16diff --git a/src/main/python/fysom/__init__.py b/src/main/python/fysom/__init__.py
17index 6458bbb..179512f 100644
18--- a/fysom/__init__.py
19+++ b/fysom/__init__.py
20@@ -27,12 +27,16 @@
21 # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 #
23
24-import collections
25 import functools
26 import weakref
27 import types
28 import sys
29
30+try:
31+ from collections.abc import Mapping
32+except ImportError:
33+ from collections import Mapping
34+
35 __author__ = 'Mansour Behabadi'
36 __copyright__ = 'Copyright 2011, Mansour Behabadi and Jake Gordon'
37 __credits__ = ['Mansour Behabadi', 'Jake Gordon']
38@@ -159,7 +163,7 @@ def __init__(self, cfg={}, initial=None, events=None, callbacks=None,
39 # convert 3-tuples in the event specification to dicts
40 events_dicts = []
41 for e in cfg["events"]:
42- if isinstance(e, collections.Mapping):
43+ if isinstance(e, Mapping):
44 events_dicts.append(e)
45 elif hasattr(e, "__iter__"):
46 name, src, dst = list(e)[:3]
47@@ -520,7 +524,7 @@ def is_very_angry(self, event):
48 # convert 3-tuples in the event specification to dicts
49 events_dicts = []
50 for e in cfg["events"]:
51- if isinstance(e, collections.Mapping):
52+ if isinstance(e, Mapping):
53 events_dicts.append(e)
54 elif hasattr(e, "__iter__"):
55 name, src, dst = list(e)[:3]
diff --git a/debian/patches/series b/debian/patches/series
0new file mode 10064456new file mode 100644
index 0000000..f4b8e53
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
1import_abc_from_collections_abc.patch

Subscribers

People subscribed via source and target branches