Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-ansiwrap for openSUSE:Factory 
checked in at 2024-01-16 21:38:22
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-ansiwrap (Old)
 and      /work/SRC/openSUSE:Factory/.python-ansiwrap.new.9992 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-ansiwrap"

Tue Jan 16 21:38:22 2024 rev:3 rq:1139057 version:0.8.4

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-ansiwrap/python-ansiwrap.changes  
2023-03-19 00:33:19.712874037 +0100
+++ 
/work/SRC/openSUSE:Factory/.python-ansiwrap.new.9992/python-ansiwrap.changes    
    2024-01-16 21:38:30.929634944 +0100
@@ -1,0 +2,7 @@
+Tue Jan 16 03:29:03 UTC 2024 - Steve Kowalik <[email protected]>
+
+- Add patch support-python312.patch:
+  * Use importlib not imp, also includes changes from the previous patch.
+- Drop patch ansiwrap-pr18-py311.patch, included in above.
+
+-------------------------------------------------------------------

Old:
----
  ansiwrap-pr18-py311.patch

New:
----
  support-python312.patch

BETA DEBUG BEGIN:
  Old:  * Use importlib not imp, also includes changes from the previous patch.
- Drop patch ansiwrap-pr18-py311.patch, included in above.
BETA DEBUG END:

BETA DEBUG BEGIN:
  New:
- Add patch support-python312.patch:
  * Use importlib not imp, also includes changes from the previous patch.
BETA DEBUG END:

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-ansiwrap.spec ++++++
--- /var/tmp/diff_new_pack.AAtrVD/_old  2024-01-16 21:38:31.709663382 +0100
+++ /var/tmp/diff_new_pack.AAtrVD/_new  2024-01-16 21:38:31.709663382 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python-ansiwrap
 #
-# Copyright (c) 2023 SUSE LLC
+# Copyright (c) 2024 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -21,11 +21,10 @@
 Release:        0
 Summary:        Textwrap, but savvy to ANSI colors and styles
 License:        Apache-2.0
-Group:          Development/Languages/Python
 URL:            https://github.com/jonathaneunice/ansiwrap
 Source:         
https://files.pythonhosted.org/packages/source/a/ansiwrap/ansiwrap-%{version}.zip
-# PATCH-FIX-UPSTREAM ansiwrap-pr18-py311.patch gh#jonathaneunice/ansiwrap#18
-Patch0:         ansiwrap-pr18-py311.patch
+# PATCH-FIX-UPSTREAM gh#jonathaneunice/ansiwrap#20
+Patch0:         support-python312.patch
 BuildRequires:  %{python_module pip}
 BuildRequires:  %{python_module setuptools}
 BuildRequires:  %{python_module wheel}

++++++ support-python312.patch ++++++
>From ab7b86c9c8a90206f969a006d9297a60ca931496 Mon Sep 17 00:00:00 2001
From: "Benjamin A. Beasley" <[email protected]>
Date: Mon, 20 Jun 2022 09:27:40 -0400
Subject: [PATCH 1/2] Fix tests on Python 3.11 (fix #18)

random.sample() population must be a sequence
---
 test/test_ansiwrap.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/test/test_ansiwrap.py b/test/test_ansiwrap.py
index 13e7149..bf7456e 100644
--- a/test/test_ansiwrap.py
+++ b/test/test_ansiwrap.py
@@ -20,8 +20,8 @@
 
 # as an alternative to testing all lengths at all times, which is slow,
 # choose a few other lengths at random
-other_lengths = (random.sample(set(range(20, 120)).difference(LINE_LENGTHS), 
2) +
-                 random.sample(set(range(120, 400)).difference(LINE_LENGTHS), 
1))
+other_lengths = (random.sample(list(set(range(20, 
120)).difference(LINE_LENGTHS)), 2) +
+                 random.sample(list(set(range(120, 
400)).difference(LINE_LENGTHS)), 1))
 LINE_LENGTHS.extend(other_lengths)
 
 

>From f6393a1e96b2d904f1a0d860930eacb5440c49fb Mon Sep 17 00:00:00 2001
From: "Benjamin A. Beasley" <[email protected]>
Date: Thu, 29 Jun 2023 16:29:52 -0400
Subject: [PATCH 2/2] Work around imp module removal in Python 3.12

---
 ansiwrap/core.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ansiwrap/core.py b/ansiwrap/core.py
index 88ff453..99d0f44 100644
--- a/ansiwrap/core.py
+++ b/ansiwrap/core.py
@@ -3,12 +3,12 @@
 from ansiwrap.ansistate import ANSIState
 import re
 import sys
-import imp
+import importlib
 
 # import a copy of textwrap3 which we will viciously monkey-patch
 # to use our version of len, not the built-in
 import os
-a_textwrap = imp.load_module('a_textwrap', *imp.find_module('textwrap3'))
+a_textwrap = importlib.import_module('textwrap3')
 
 
 __all__ = 'wrap fill shorten strip_color ansilen ansi_terminate_lines'.split()

Reply via email to