15
0

Accepting request 788438 from devel:languages:python:backports

OBS-URL: https://build.opensuse.org/request/show/788438
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-ansi2html?expand=0&rev=6
This commit is contained in:
Tomáš Chvátal
2020-03-26 08:02:12 +00:00
committed by Git OBS Bridge
parent 48267b8f8e
commit 80f3451895
3 changed files with 44 additions and 3 deletions

View File

@@ -1,3 +1,8 @@
-------------------------------------------------------------------
Thu Mar 26 07:34:53 UTC 2020 - Paolo Stivanin <info@paolostivanin.com>
- Add remove_nose.patch
-------------------------------------------------------------------
Fri Feb 15 14:23:43 UTC 2019 - Jan Engelhardt <jengelh@inai.de>

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-ansi2html
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -25,8 +25,9 @@ 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
# https://github.com/ralphbean/ansi2html/pull/103
Patch0: remove_nose.patch
BuildRequires: %{python_module mock}
BuildRequires: %{python_module nose}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module six}
BuildRequires: fdupes
@@ -42,6 +43,7 @@ A module to convert text with ANSI color codes to HTML or to LaTeX.
%prep
%setup -q -n ansi2html-%{version}
%patch0 -p1
%build
%python_build
@@ -52,7 +54,7 @@ A module to convert text with ANSI color codes to HTML or to LaTeX.
%python_clone -a %{buildroot}%{_bindir}/ansi2html
%check
%python_expand PYTHONPATH=%{buildroot}%{$python_sitelib} %{_bindir}/nosetests-%{$python_bin_suffix} tests/test_ansi2html.py
%python_exec -m unittest discover -s tests/ -v
%post
%python_install_alternative ansi2html

34
remove_nose.patch Normal file
View File

@@ -0,0 +1,34 @@
diff -ru ansi2html-1.5.2/tests/test_ansi2html.py ansi2html-1.5.2-new/tests/test_ansi2html.py
--- a/tests/test_ansi2html.py 2018-10-22 16:44:16.000000000 +0200
+++ b/tests/test_ansi2html.py 2020-03-26 08:24:03.619984982 +0100
@@ -31,7 +31,6 @@
from ansi2html.util import read_to_unicode
from mock import patch
-from nose.tools import eq_
import unittest
import six
@@ -117,7 +116,8 @@
with patch("sys.stdin", new_callable=lambda: six.StringIO(test_input)):
main()
- eq_(mock_stdout.getvalue(), test_input)
+ ms_val = mock_stdout.getvalue()
+ assert ms_val == test_input, "%r != %r" % (ms_val, test_input)
@patch("sys.argv", new_callable=lambda: ["ansi2html", "--partial"])
@patch("sys.stdout", new_callable=six.StringIO)
diff -ru ansi2html-1.5.2/tox.ini ansi2html-1.5.2-new/tox.ini
--- a/tox.ini 2018-10-22 16:44:16.000000000 +0200
+++ b/tox.ini 2020-03-26 08:24:03.619984982 +0100
@@ -9,8 +9,7 @@
py35: python3.5
py36: python3.6
deps =
- nose
mock
sitepackages = False
commands =
- nosetests tests/test_ansi2html.py
+ unittest tests/test_ansi2html.py