From ae889120c31ea2ec389ab8aec2133083e9c026b9f4ed14a8115b1565ef8bb56f Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Wed, 19 Jun 2024 06:45:10 +0000 Subject: [PATCH] - Add patch drop-textwrap3.patch: * Use textwrap, textwrap3 is a backport for Python < 3.6. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-ansiwrap?expand=0&rev=7 --- drop-textwrap3.patch | 42 +++++++++++++++++++++++++++++++++++++++++ python-ansiwrap.changes | 6 ++++++ python-ansiwrap.spec | 3 ++- 3 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 drop-textwrap3.patch diff --git a/drop-textwrap3.patch b/drop-textwrap3.patch new file mode 100644 index 0000000..dc9d478 --- /dev/null +++ b/drop-textwrap3.patch @@ -0,0 +1,42 @@ +Index: ansiwrap-0.8.4/ansiwrap/core.py +=================================================================== +--- ansiwrap-0.8.4.orig/ansiwrap/core.py ++++ ansiwrap-0.8.4/ansiwrap/core.py +@@ -5,10 +5,10 @@ import re + import sys + import importlib + +-# import a copy of textwrap3 which we will viciously monkey-patch ++# import a copy of textwrap which we will viciously monkey-patch + # to use our version of len, not the built-in + import os +-a_textwrap = importlib.import_module('textwrap3') ++a_textwrap = importlib.import_module('textwrap') + + + __all__ = 'wrap fill shorten strip_color ansilen ansi_terminate_lines'.split() +Index: ansiwrap-0.8.4/setup.py +=================================================================== +--- ansiwrap-0.8.4.orig/setup.py ++++ ansiwrap-0.8.4/setup.py +@@ -23,7 +23,7 @@ setup( + license='Apache License 2.0', + packages=['ansiwrap'], + setup_requires=[], +- install_requires=['textwrap3>=0.9.2'], ++ install_requires=["textwrap3>=0.9.2; python_version < '3.6'"], + tests_require=['tox', 'pytest', 'ansicolors>=1.1.8', 'coverage', 'pytest-cov'], + test_suite="test", + zip_safe=False, +Index: ansiwrap-0.8.4/test/test_ansiwrap.py +=================================================================== +--- ansiwrap-0.8.4.orig/test/test_ansiwrap.py ++++ ansiwrap-0.8.4/test/test_ansiwrap.py +@@ -1,6 +1,6 @@ + # -*- coding: utf-8 -*- + +-import textwrap3 as textwrap ++import textwrap + from colors import * # must come before ansiwrap import + # so ansiwrap's better strip_color prevails + diff --git a/python-ansiwrap.changes b/python-ansiwrap.changes index 3c1848a..81e739a 100644 --- a/python-ansiwrap.changes +++ b/python-ansiwrap.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Jun 19 06:44:55 UTC 2024 - Steve Kowalik + +- Add patch drop-textwrap3.patch: + * Use textwrap, textwrap3 is a backport for Python < 3.6. + ------------------------------------------------------------------- Tue Jan 16 03:29:03 UTC 2024 - Steve Kowalik diff --git a/python-ansiwrap.spec b/python-ansiwrap.spec index d0ac936..b734cde 100644 --- a/python-ansiwrap.spec +++ b/python-ansiwrap.spec @@ -25,6 +25,8 @@ URL: https://github.com/jonathaneunice/ansiwrap Source: https://files.pythonhosted.org/packages/source/a/ansiwrap/ansiwrap-%{version}.zip # PATCH-FIX-UPSTREAM gh#jonathaneunice/ansiwrap#20 Patch0: support-python312.patch +# PATCH-FIX-UPSTREAM Based on gh#jonathaneunice/ansiwrap#16 +Patch1: drop-textwrap3.patch BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module wheel} @@ -34,7 +36,6 @@ BuildRequires: unzip # SECTION test requirements BuildRequires: %{python_module ansicolors >= 1.1.8} BuildRequires: %{python_module pytest} -BuildRequires: %{python_module textwrap3} # /SECTION Requires: python-textwrap3 BuildArch: noarch