15
0

Accepting request 1085702 from home:ojkastl_buildservice:Branch_devel_languages_python

OBS-URL: https://build.opensuse.org/request/show/1085702
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-ansi2html?expand=0&rev=12
This commit is contained in:
2023-05-09 20:49:12 +00:00
committed by Git OBS Bridge
parent c25fbf88ff
commit 323de07fb3
3 changed files with 54 additions and 2 deletions

View File

@@ -0,0 +1,33 @@
From 01aa299300788591e91dd7290c455240056607a0 Mon Sep 17 00:00:00 2001
From: Johannes Kastl <kastl@b1-systems.de>
Date: Tue, 9 May 2023 14:00:51 +0200
Subject: [PATCH] tests/test_ansi2html.py: use sys.executable instead of
hardcoded python3
Signed-off-by: Johannes Kastl <kastl@b1-systems.de>
---
tests/test_ansi2html.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tests/test_ansi2html.py b/tests/test_ansi2html.py
index 04b5d22..2e88a8f 100644
--- a/tests/test_ansi2html.py
+++ b/tests/test_ansi2html.py
@@ -22,6 +22,7 @@
# <http://www.gnu.org/licenses/>.
import textwrap
+import sys
from io import StringIO
from os.path import abspath, dirname, join
from subprocess import PIPE, Popen, run
@@ -499,5 +500,5 @@ class TestAnsi2HTML:
assert process.returncode == 0
def test_command_module(self) -> None:
- result = run(["python3", "-m", "ansi2html", "--version"], check=True)
+ result = run([sys.executable, "-m", "ansi2html", "--version"], check=True)
assert result.returncode == 0
--
2.40.1

View File

@@ -1,3 +1,17 @@
-------------------------------------------------------------------
Tue May 9 12:02:38 UTC 2023 - Johannes Kastl <kastl@b1-systems.de>
- add patch
0001-tests-test_ansi2html.py-use-sys.executable-instead-o.patch
to replace a hardcoded 'python3' in a test (which leads to errors
on SLES15 with python3.11)
https://github.com/pycontribs/ansi2html/issues/210
-------------------------------------------------------------------
Tue May 9 11:20:43 UTC 2023 - Johannes Kastl <kastl@b1-systems.de>
- add sle15_python_module_pythons
-------------------------------------------------------------------
Thu Aug 4 08:46:29 UTC 2022 - Otto Hollmann <otto.hollmann@suse.com>

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-ansi2html
#
# Copyright (c) 2022 SUSE LLC
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,7 +16,7 @@
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%{?sle15_python_module_pythons}
Name: python-ansi2html
Version: 1.8.0
Release: 0
@@ -25,6 +25,10 @@ License: LGPL-3.0-or-later
Group: Development/Languages/Python
URL: https://github.com/ralphbean/ansi2html/
Source: https://github.com/ralphbean/ansi2html/archive/%{version}.tar.gz
# PATCH-FIX-UPSTREAM
# 0001-tests-test_ansi2html.py-use-sys.executable-instead-o.patch
# gh#pycontribs/ansi2html#210 kastl@b1-systems.de
Patch0: 0001-tests-test_ansi2html.py-use-sys.executable-instead-o.patch
BuildRequires: %{python_module pip}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools}
@@ -42,6 +46,7 @@ A module to convert text with ANSI color codes to HTML or to LaTeX.
%prep
%setup -q -n ansi2html-%{version}
%patch0 -p1
%build
%pyproject_wheel