Control: tags -1 + patch

On Tuesday, May 14 2024, Adrian Bunk wrote:

> Control: reopen -1
>
> On Mon, Feb 12, 2024 at 10:57:03PM +0000, Debian Bug Tracking System wrote:
>>...
>>  python-nmea2 (1.19.0-1) unstable; urgency=medium
>>  .
>>    * New upstream release (Closes: #1058130).
>>...
>> Relevant part (hopefully):
>> >  fakeroot debian/rules clean
>> > dh clean --with python3 --buildsystem=pybuild
>> >    dh_auto_clean -O--buildsystem=pybuild
>> > I: pybuild base:310: python3.12 setup.py clean 
>> > Traceback (most recent call last):
>> >   File "/<<PKGBUILDDIR>>/setup.py", line 3, in <module>
>> >     import imp
>> > ModuleNotFoundError: No module named 'imp'
>> > E: pybuild pybuild:395: clean: plugin distutils failed with: exit code=1: 
>> > python3.12 setup.py clean 
>> > dh_auto_clean: error: pybuild --clean -i python{version} -p "3.12 3.11" 
>> > returned exit code 13
>> > make: *** [debian/rules:7: clean] Error 25
>>...
>
> The fix is not included in 1.19.0-2:
> https://buildd.debian.org/status/fetch.php?pkg=python-nmea2&arch=all&ver=1.19.0-2&stamp=1715629490&raw=0

Upstream has not made a proper release yet; the following debdiff fixes
the issue meanwhile.

Thanks,

-- 
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF  31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
https://sergiodj.net/

diff -Nru 
python-nmea2-1.19.0/debian/patches/0001-Python-3.12-compatibility-164.patch 
python-nmea2-1.19.0/debian/patches/0001-Python-3.12-compatibility-164.patch
--- python-nmea2-1.19.0/debian/patches/0001-Python-3.12-compatibility-164.patch 
1969-12-31 19:00:00.000000000 -0500
+++ python-nmea2-1.19.0/debian/patches/0001-Python-3.12-compatibility-164.patch 
2024-06-11 13:55:12.000000000 -0400
@@ -0,0 +1,72 @@
+From: Simon H <howroyd...@gmail.com>
+Date: Sun, 11 Feb 2024 17:59:59 +0000
+Subject: Python 3.12 compatibility (#164)
+
+* Removed depreciated `imp` and replaced with `importlib`
+
+* Updated meta classifiers to include newer Python versions
+
+* Added Python3.12 into github workflow action
+
+* Updated workflow to test all versions we say we do
+
+* Tidied mixed markup styles
+
+* Assed Windows and MacOS to tests
+
+* Updated depreciated setup-python action to v5
+
+* Adding Python3.12 to Action
+
+* Removed my test branch from Actions
+
+Origin: backport, 
https://github.com/Knio/pynmea2/commit/802bfb627eb05a1ee655854dd261800061322b9a
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1058130
+
+This patch has been adjusted to contain only the necessary bits from
+setup.py.  All the other changes were dropped.
+---
+ setup.py | 24 ++++++++++++++++++++++--
+ 1 file changed, 22 insertions(+), 2 deletions(-)
+
+diff --git a/setup.py b/setup.py
+index facd391..d9d3eb8 100644
+--- a/setup.py
++++ b/setup.py
+@@ -1,7 +1,24 @@
++import importlib.machinery
++import importlib.util
++
+ from setuptools import setup
+ 
+-import imp
+-_version = imp.load_source("pynmea2._version", "pynmea2/_version.py")
++
++def load_source(modname, filename):
++    """Load a source file and return its module object.
++
++    From: https://docs.python.org/3.12/whatsnew/3.12.html#imp
++    """
++    loader = importlib.machinery.SourceFileLoader(modname, filename)
++    spec = importlib.util.spec_from_file_location(modname, filename, 
loader=loader)
++    module = importlib.util.module_from_spec(spec)
++    # The module is always executed and not cached in sys.modules.
++    # Uncomment the following line to cache the module.
++    # sys.modules[module.__name__] = module
++    loader.exec_module(module)
++    return module
++
++_version = load_source("pynmea2._version", "pynmea2/_version.py")
+ 
+ setup(
+     name='pynmea2',
+@@ -29,6 +46,9 @@ setup(
+         'Programming Language :: Python :: 3.7',
+         'Programming Language :: Python :: 3.8',
+         'Programming Language :: Python :: 3.9',
++        'Programming Language :: Python :: 3.10',
++        'Programming Language :: Python :: 3.11',
++        'Programming Language :: Python :: 3.12',
+         'Programming Language :: Python :: Implementation :: PyPy',
+         'Topic :: Scientific/Engineering :: GIS',
+         'Topic :: Software Development :: Libraries :: Python Modules',
diff -Nru python-nmea2-1.19.0/debian/patches/series 
python-nmea2-1.19.0/debian/patches/series
--- python-nmea2-1.19.0/debian/patches/series   1969-12-31 19:00:00.000000000 
-0500
+++ python-nmea2-1.19.0/debian/patches/series   2024-06-11 13:55:12.000000000 
-0400
@@ -0,0 +1 @@
+0001-Python-3.12-compatibility-164.patch

Attachment: signature.asc
Description: PGP signature

Reply via email to