Merge ~j-rivero/ubuntu/+source/ros2-colcon-core:ubuntu/devel into ubuntu/+source/ros2-colcon-core:ubuntu/devel

Proposed by Jose Luis Rivero
Status: Merged
Merged at revision: 5f996d17c6fbb3fe902f126f330e8314375ae327
Proposed branch: ~j-rivero/ubuntu/+source/ros2-colcon-core:ubuntu/devel
Merge into: ubuntu/+source/ros2-colcon-core:ubuntu/devel
Diff against target: 93 lines (+59/-1)
4 files modified
debian/changelog (+7/-0)
debian/control (+2/-1)
debian/patches/0004-Fix-argument-parsing-in-newer-Python.patch (+49/-0)
debian/patches/series (+1/-0)
Reviewer Review Type Date Requested Status
Benjamin Drung (community) Approve
git-ubuntu import Pending
Review via email: mp+464037@code.launchpad.net

Commit message

Import upstream patch to fix argument parsing in newer python 3.12 / python 3.11

To post a comment you must log in.
Revision history for this message
Benjamin Drung (bdrung) wrote :

Thanks. Merged and uploaded.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index c2b9ade..dc2f135 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,10 @@
6+ros2-colcon-core (0.15.2-1ubuntu1) noble; urgency=medium
7+
8+ * Add patch to fix argument parsing with Python 3.12
9+ (LP: #2060717)
10+
11+ -- Jose Luis Rivero <jrivero@osrfoundation.org> Tue, 09 Apr 2024 20:51:44 +0200
12+
13 ros2-colcon-core (0.15.2-1) unstable; urgency=medium
14
15 * New upstream version 0.15.2
16diff --git a/debian/control b/debian/control
17index 529f59e..3b2c885 100644
18--- a/debian/control
19+++ b/debian/control
20@@ -1,7 +1,8 @@
21 Source: ros2-colcon-core
22 Section: python
23 Priority: optional
24-Maintainer: Debian Robotics Team <team+robotics@tracker.debian.org>
25+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
26+XSBC-Original-Maintainer: Debian Robotics Team <team+robotics@tracker.debian.org>
27 Uploaders:
28 Timo Röhling <roehling@debian.org>,
29 Jochen Sprickerhof <jspricke@debian.org>,
30diff --git a/debian/patches/0004-Fix-argument-parsing-in-newer-Python.patch b/debian/patches/0004-Fix-argument-parsing-in-newer-Python.patch
31new file mode 100644
32index 0000000..63ab21b
33--- /dev/null
34+++ b/debian/patches/0004-Fix-argument-parsing-in-newer-Python.patch
35@@ -0,0 +1,49 @@
36+From: Chris Lalancette <clalancette@gmail.com>
37+Subject: Fix argument parsing in newer Python
38+Origin: upstream, https://github.com/colcon/colcon-core/pull/635
39+
40+---
41+diff --git a/colcon_core/command.py b/colcon_core/command.py
42+index fd159be10591..228d3b369099 100644
43+--- a/colcon_core/command.py
44++++ b/colcon_core/command.py
45+@@ -226,7 +226,15 @@ def create_parser(environment_variables_group_name):
46+
47+ def _parse_optional(self, arg_string):
48+ result = super()._parse_optional(arg_string)
49+- if result == (None, arg_string, None):
50++ # Up until https://github.com/python/cpython/pull/114180 ,
51++ # _parse_optional() returned a 3-tuple when it couldn't classify
52++ # the option. As of that PR (which is in Python 3.13, and
53++ # backported to Python 3.12), it returns a 4-tuple. Check for
54++ # either here.
55++ if result in (
56++ (None, arg_string, None),
57++ (None, arg_string, None, None),
58++ ):
59+ # in the case there the arg is classified as an unknown 'O'
60+ # override that and classify it as an 'A'
61+ return None
62+diff --git a/test/spell_check.words b/test/spell_check.words
63+index 96051a0ff2c3..83548464c76a 100644
64+--- a/test/spell_check.words
65++++ b/test/spell_check.words
66+@@ -3,6 +3,7 @@ apache
67+ argparse
68+ asyncio
69+ autouse
70++backported
71+ basepath
72+ bazqux
73+ blocklist
74+@@ -17,6 +18,7 @@ configparser
75+ contextlib
76+ coroutine
77+ coroutines
78++cpython
79+ datetime
80+ debian
81+ debinfo
82+--
83+2.42.0
84+
85diff --git a/debian/patches/series b/debian/patches/series
86index 0a8df8d..11d19c6 100644
87--- a/debian/patches/series
88+++ b/debian/patches/series
89@@ -1,3 +1,4 @@
90 0001-Respect-DEB_PYTHON_INSTALL_LAYOUT.patch
91 0002-Ignore-DeprecationWarning-about-pkg_resources.patch
92 0003-Use-pristine-home-directory-for-Python-tests.patch
93+0004-Fix-argument-parsing-in-newer-Python.patch

Subscribers

People subscribed via source and target branches