[med-svn] [Git][python-team/packages/sphinxcontrib-autoprogram][master] 3 commits: add python3.12 patch
Alexandre Detiste (@detiste-guest)
gitlab at salsa.debian.org
Wed Mar 13 15:35:59 GMT 2024
Alexandre Detiste pushed to branch master at Debian Python Team / packages / sphinxcontrib-autoprogram
Commits:
37f3588e by Alexandre Detiste at 2024-03-13T16:31:03+01:00
add python3.12 patch
- - - - -
26bec736 by Alexandre Detiste at 2024-03-13T16:32:05+01:00
pre-release
- - - - -
a65a78c5 by Alexandre Detiste at 2024-03-13T16:32:26+01:00
add missing patch
- - - - -
3 changed files:
- debian/changelog
- + debian/patches/python312.patch
- debian/patches/series
Changes:
=====================================
debian/changelog
=====================================
@@ -1,3 +1,10 @@
+sphinxcontrib-autoprogram (0.1.8-2) unstable; urgency=medium
+
+ * Team upload.
+ * add upstream patch for python3.12 compatibility
+
+ -- Alexandre Detiste <tchet at debian.org> Wed, 13 Mar 2024 16:31:38 +0100
+
sphinxcontrib-autoprogram (0.1.8-1) unstable; urgency=medium
* Team upload.
=====================================
debian/patches/python312.patch
=====================================
@@ -0,0 +1,57 @@
+From bd3ba456535d928381a7d111afa92878148ddc0f Mon Sep 17 00:00:00 2001
+From: Rogdham <contact at rogdham.net>
+Date: Sat, 9 Mar 2024 10:27:35 +0100
+Subject: [PATCH] Remove imp dependency
+
+See https://docs.python.org/3/whatsnew/3.12.html#imp
+---
+ sphinxcontrib/autoprogram.py | 15 ++++++++++++---
+ 1 file changed, 12 insertions(+), 3 deletions(-)
+
+diff --git a/sphinxcontrib/autoprogram.py b/sphinxcontrib/autoprogram.py
+index ef479e7..663cb16 100644
+--- a/sphinxcontrib/autoprogram.py
++++ b/sphinxcontrib/autoprogram.py
+@@ -18,6 +18,7 @@
+ import os
+ import re
+ import sys
++import tempfile
+ from functools import reduce
+ from typing import Any, Dict, Iterable, List, Optional, Tuple
+ import unittest
+@@ -144,16 +145,16 @@ def import_object(import_name: str):
+ # the script, if there is a script named module_name. Otherwise, raise
+ # an ImportError as it did before.
+ import glob
+- import sys
+ import os
+- import imp
++ import sys
++ import types
+
+ for p in sys.path:
+ f = glob.glob(os.path.join(p, module_name))
+ if len(f) > 0:
+ with open(f[0]) as fobj:
+ codestring = fobj.read()
+- foo = imp.new_module("foo")
++ foo = types.ModuleType("foo")
+ exec(codestring, foo.__dict__)
+
+ sys.modules["foo"] = foo
+@@ -590,6 +591,14 @@ def test_import_object(self) -> None:
+ )
+ self.assertIsInstance(instance, UtilTestCase)
+
++ def test_import_object_filename(self) -> None:
++ with tempfile.TemporaryDirectory() as tmpdirname:
++ filename = os.path.join(tmpdirname, 'somefile')
++ with open(filename, 'w') as fp:
++ fp.write("bar = 42\n")
++ value = import_object("{}:bar".format(filename))
++ self.assertTrue(value == 42)
++
+ if not hasattr(unittest.TestCase, "assertIsInstance"):
+
+ def assertIsInstance(self, instance, cls) -> None: # type: ignore[override]
=====================================
debian/patches/series
=====================================
@@ -1 +1,2 @@
remove-six.patch
+python312.patch
View it on GitLab: https://salsa.debian.org/python-team/packages/sphinxcontrib-autoprogram/-/compare/49cf28fe26fcca88c38000c35f749dc4749288f3...a65a78c5245572cfaf1a41c614e6c749f3ed7b20
--
View it on GitLab: https://salsa.debian.org/python-team/packages/sphinxcontrib-autoprogram/-/compare/49cf28fe26fcca88c38000c35f749dc4749288f3...a65a78c5245572cfaf1a41c614e6c749f3ed7b20
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20240313/ca15aeec/attachment-0001.htm>
More information about the debian-med-commit
mailing list