17
0

Compare commits

7 Commits

Author SHA256 Message Date
faafd2cfb3 Accepting request 1286722 from devel:languages:python
- Use better expression to get version.

OBS-URL: https://build.opensuse.org/request/show/1286722
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-ansi2html?expand=0&rev=10
2025-06-18 17:42:01 +00:00
548393390e - Use better expression to get version.
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-ansi2html?expand=0&rev=21
2025-06-18 14:27:12 +00:00
993231e7d6 Accepting request 1286460 from devel:languages:python
- Add opensuse-test.patch making the tests work even with
  versioned executables in the testing environment (i.e., before
  the alts scriptlets kick in).
- Convert to libalternatives

OBS-URL: https://build.opensuse.org/request/show/1286460
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-ansi2html?expand=0&rev=9
2025-06-18 13:57:42 +00:00
0851623132 - Add opensuse-test.patch making the tests work even with
versioned executables in the testing environment (i.e., before
  the alts scriptlets kick in).

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-ansi2html?expand=0&rev=19
2025-06-17 20:31:23 +00:00
eb470ecfc7 - Convert to libalternatives
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-ansi2html?expand=0&rev=18
2025-06-16 12:21:10 +00:00
7c5568406f Accepting request 1183017 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/1183017
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-ansi2html?expand=0&rev=8
2024-06-24 18:56:47 +00:00
04ae4c6860 Accepting request 1182732 from home:ojkastl_buildservice:Branch_devel_languages_python
OBS-URL: https://build.opensuse.org/request/show/1182732
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-ansi2html?expand=0&rev=16
2024-06-24 12:17:56 +00:00
5 changed files with 82 additions and 14 deletions

34
opensuse-test.patch Normal file
View File

@@ -0,0 +1,34 @@
---
tests/test_ansi2html.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
Index: ansi2html-1.9.2/tests/test_ansi2html.py
===================================================================
--- ansi2html-1.9.2.orig/tests/test_ansi2html.py 2024-06-22 19:22:24.000000000 +0200
+++ ansi2html-1.9.2/tests/test_ansi2html.py 2025-06-18 16:25:45.121652936 +0200
@@ -50,6 +50,7 @@
class TestAnsi2HTML:
maxDiff = None
+ cmd_exe = "ansi2html-%d.%d" % sys.version_info[:2]
def test_linkify(self) -> None:
ansi = "http://threebean.org#foobar"
@@ -465,7 +466,7 @@
assert target in html
def test_command_script(self) -> None:
- result = run(["ansi2html", "--version"], check=True)
+ result = run([self.cmd_exe, "--version"], check=True)
assert result.returncode == 0
def test_command_input_output_encoding(self) -> None:
@@ -480,7 +481,7 @@
with Popen(
[
- "ansi2html",
+ self.cmd_exe,
"--inline",
f"--input-encoding={input_encoding}",
f"--output-encoding={output_encoding}",

View File

@@ -1,3 +1,33 @@
-------------------------------------------------------------------
Wed Jun 18 14:27:04 UTC 2025 - Matej Cepl <mcepl@cepl.eu>
- Use better expression to get version.
-------------------------------------------------------------------
Tue Jun 17 20:29:28 UTC 2025 - Matej Cepl <mcepl@cepl.eu>
- Add opensuse-test.patch making the tests work even with
versioned executables in the testing environment (i.e., before
the alts scriptlets kick in).
-------------------------------------------------------------------
Mon Jun 16 12:20:51 UTC 2025 - Markéta Machová <mmachova@suse.com>
- Convert to libalternatives
-------------------------------------------------------------------
Sun Jun 23 07:43:43 UTC 2024 - Johannes Kastl <opensuse_buildservice@ojkastl.de>
- update to 1.9.2:
* github.com/psf/black.git: 24.1.1 → 24.4.2
<https://github.com/psf/black.git/compare/24.1.1...24.4.2>
* github.com/pre-commit/pre-commit-hooks.git: v4.5.0 → v4.6.0
<https://github.com/pre-commit/pre-commit-hooks.git/compare/v4.5.0...v4.6.0>
* github.com/pycqa/pylint: v3.0.3 → v3.2.2
<https://github.com/pycqa/pylint/compare/v3.0.3...v3.2.2>
* github.com/pre-commit/mirrors-mypy: v1.8.0 → v1.10.0
<https://github.com/pre-commit/mirrors-mypy/compare/v1.8.0...v1.10.0>
-------------------------------------------------------------------
Wed Dec 13 08:54:07 UTC 2023 - Johannes Kastl <kastl@b1-systems.de>

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-ansi2html
#
# Copyright (c) 2023 SUSE LLC
# Copyright (c) 2025 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,23 +16,29 @@
#
%bcond_without libalternatives
%{?sle15_python_module_pythons}
Name: python-ansi2html
Version: 1.9.1
Version: 1.9.2
Release: 0
Summary: Python module to convert text with ANSI color codes to HTML or LaTeX
License: LGPL-3.0-or-later
Group: Development/Languages/Python
URL: https://github.com/pycontribs/ansi2html/
Source: https://github.com/pycontribs/ansi2html/archive/v%{version}.tar.gz
# PATCH-FIX-OPENSUSE opensuse-test.patch bsc#[0-9]+ mcepl@suse.com
# Make tests work with versioned executables before alts kick in
# If any other test fails, because the executable is not
# "ansi2html", replace it with self.cmd_exe
Patch0: opensuse-test.patch
BuildRequires: %{python_module pip}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: alts
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires(post): update-alternatives
Requires(postun):update-alternatives
Requires: alts
BuildArch: noarch
%python_subpackages
@@ -44,7 +50,7 @@ Inspired by and developed off of the work of pixelbeat and blackjack.
Read the [docs](https://ansi2html.readthedocs.io/) for more informations.
%prep
%setup -q -n ansi2html-%{version}
%autosetup -p1 -n ansi2html-%{version}
%build
%pyproject_wheel
@@ -57,15 +63,13 @@ Read the [docs](https://ansi2html.readthedocs.io/) for more informations.
%check
# https://github.com/pycontribs/ansi2html/issues/169
sed -i 's:from mock:from unittest.mock:' tests/test_ansi2html.py
export PATH=$PATH:%{buildroot}%{_bindir}
# ansi2html not available (update alternatives); solvable
# but it runs just ansi2html --version
%pytest -k 'not test_command_script'
%pytest
%post
%python_install_alternative ansi2html
%postun
%python_uninstall_alternative ansi2html
%pre
%python_libalternatives_reset_alternative ansi2html
%files %{python_files}
%license LICENSE

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:08395451ee39e661ad6e5449ff8334cf30bb9844755c666764c5d6bb08d758c5
size 40326

3
v1.9.2.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d4a12e0d0ed06af467882bcc24fad34ddcf7d4d61f237125ce7713f7f1341c3f
size 40333