[packages/python3-subunit] - python-subunit.spec updated to 1.4.3 for python 3.7+

qboosh qboosh at pld-linux.org
Fri Sep 29 18:58:27 CEST 2023


commit 0b86a8f2582d2c0b0c5b3f74886737ebe79c063b
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Fri Sep 29 18:34:27 2023 +0200

    - python-subunit.spec updated to 1.4.3 for python 3.7+

 python-subunit-tests.patch                  |  65 +++-----------
 python-subunit.spec => python3-subunit.spec | 132 ++++------------------------
 2 files changed, 27 insertions(+), 170 deletions(-)
---
diff --git a/python-subunit.spec b/python3-subunit.spec
similarity index 53%
rename from python-subunit.spec
rename to python3-subunit.spec
index a599f8b..a38c8cc 100644
--- a/python-subunit.spec
+++ b/python3-subunit.spec
@@ -1,86 +1,42 @@
 #
 # Conditional build:
-%bcond_without	python2 # CPython 2.x module and tools
-%bcond_without	python3 # CPython 3.x module and tools
 %bcond_without	tests	# unit tests
 
 Summary:	subunit - streaming protocol for test results
 Summary(pl.UTF-8):	subunit - protokół strumieniowy do wyników testów
-Name:		python-subunit
-Version:	1.4.0
-Release:	4
+Name:		python3-subunit
+Version:	1.4.3
+Release:	1
 License:	Apache v2.0 or BSD
 Group:		Libraries/Python
 #Source0Download: https://pypi.org/simple/python-subunit/
-Source0:	https://files.pythonhosted.org/packages/source/p/python-subunit/%{name}-%{version}.tar.gz
-# Source0-md5:	30f1ab20651d94442dd9a7f8c9e8d633
-Patch0:		%{name}-tests.patch
+Source0:	https://files.pythonhosted.org/packages/source/p/python-subunit/python-subunit-%{version}.tar.gz
+# Source0-md5:	30ed3d6a2586a5e29ab560c12735c58a
+Patch0:		python-subunit-tests.patch
 URL:		https://pypi.org/project/python-subunit/
-BuildRequires:	rpm-pythonprov
-BuildRequires:	rpmbuild(macros) >= 1.714
-%if %{with python2}
-BuildRequires:	python-extras
-BuildRequires:	python-modules >= 1:2.7
-BuildRequires:	python-testtools >= 0.9.34
-%if %{with tests}
-BuildRequires:	python-fixtures
-BuildRequires:	python-hypothesis
-BuildRequires:	python-testscenarios
-BuildRequires:	python-unittest2
-%endif
-%endif
-%if %{with python3}
-BuildRequires:	python3-extras
-BuildRequires:	python3-modules >= 1:3.5
+BuildRequires:	python3-modules >= 1:3.7
+BuildRequires:	python3-setuptools >= 1:43
 BuildRequires:	python3-testtools >= 0.9.34
 %if %{with tests}
 BuildRequires:	python3-fixtures
 BuildRequires:	python3-hypothesis
 BuildRequires:	python3-testscenarios
 %endif
-%endif
-Requires:	python-modules >= 1:2.7
+BuildRequires:	rpm-pythonprov
+BuildRequires:	rpmbuild(macros) >= 1.714
+Requires:	python3-modules >= 1:3.7
 BuildArch:	noarch
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
 Subunit is a streaming protocol for test results.
 
-This package contains Python 2.x modules.
+This package contains Python 3.x modules.
 
 %description -l pl.UTF-8
 Subunit to protokół strumieniowy przeznaczony do wyników testów.
 
-Ten pakiet zawiera moduły Pythona 2.x.
-
-%package -n subunit-python2
-Summary:	Python 2 tools for subunit streaming protocol for test results
-Summary(pl.UTF-8):	Narzędzia Pythona 2 dla protokołu strumieniowego do wyników testów subunit
-Group:		Development/Tools
-Requires:	python-subunit = %{version}-%{release}
-
-%description -n subunit-python2
-Python 2 tools for subunit streaming protocol for test results.
-
-%description -n subunit-python2 -l pl.UTF-8
-Narzędzia Pythona 2 dla protokołu strumieniowego do wyników testów
-subunit.
-
-%package -n python3-subunit
-Summary:	subunit - streaming protocol for test results
-Summary(pl.UTF-8):	subunit - protokół strumieniowy do wyników testów
-Group:		Libraries/Python
-Requires:	python3-modules >= 1:3.2
-
-%description -n python3-subunit
-Subunit is a streaming protocol for test results.
-
-This package contains Python 2.x modules.
-
-%description -n python3-subunit -l pl.UTF-8
-Subunit to protokół strumieniowy przeznaczony do wyników testów.
-
-Ten pakiet zawiera moduły Pythona 2.x.
+Ten pakiet zawiera moduły Pythona 3.x.
 
 %package -n subunit-python3
 Summary:	Python 3 tools for subunit streaming protocol for test results
@@ -99,11 +55,7 @@ subunit.
 Summary:	Python tools for subunit streaming protocol for test results
 Summary(pl.UTF-8):	Pythonowe narzędzia dla protokołu strumieniowego do wyników testów subunit
 Group:		Development/Tools
-%if %{with python3}
 Requires:	subunit-python3 = %{version}-%{release}
-%else
-Requires:	subunit-python2 = %{version}-%{release}
-%endif
 
 %description -n subunit-python
 Python tools for subunit streaming protocol for test results.
@@ -113,46 +65,20 @@ Pythonowe narzędzia dla protokołu strumieniowego do wyników testów
 subunit.
 
 %prep
-%setup -q
+%setup -q -n python-subunit-%{version}
 %patch0 -p1
 
 %build
-%if %{with python2}
-%py_build
-
-%if %{with tests}
-PYTHONPATH=$(pwd)/python \
-%{__python} -m subunit.run subunit.tests.test_suite | PYTHONPATH=$(pwd)/python %{__python} filters/subunit2pyunit
-%endif
-%endif
-
-%if %{with python3}
 %py3_build
 
 %if %{with tests}
 PYTHONPATH=$(pwd)/python \
-%{__python3} -m subunit.run subunit.tests.test_suite | PYTHONPATH=$(pwd)/python %{__python3} filters/subunit2pyunit
-%endif
+%{__python3} -m subunit.run subunit.tests.test_suite | PYTHONPATH=$(pwd)/python %{__python3} python/subunit/filter_scripts/subunit2pyunit.py
 %endif
 
 %install
 rm -rf $RPM_BUILD_ROOT
 
-%if %{with python2}
-%py_install
-
-%{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/subunit/tests
-%py_postclean
-
-for f in $RPM_BUILD_ROOT%{_bindir}/* ; do
-	%{__mv} "$f" "${f}-2"
-%if %{without python3}
-	ln -sf $(basename $f)-2 "$f"
-%endif
-done
-%endif
-
-%if %{with python3}
 %py3_install
 
 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/subunit/tests
@@ -163,40 +89,13 @@ for f in $RPM_BUILD_ROOT%{_bindir}/* ; do
 		ln -sf $(basename $f)-3 "$f"
 	fi
 done
-%endif
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
-%if %{with python2}
 %files
 %defattr(644,root,root,755)
 %doc NEWS README.rst
-%{py_sitescriptdir}/subunit
-%{py_sitescriptdir}/python_subunit-%{version}-py*.egg-info
-
-%files -n subunit-python2
-%defattr(644,root,root,755)
-%attr(755,root,root) %{_bindir}/subunit-1to2-2
-%attr(755,root,root) %{_bindir}/subunit-2to1-2
-%attr(755,root,root) %{_bindir}/subunit-filter-2
-%attr(755,root,root) %{_bindir}/subunit-ls-2
-%attr(755,root,root) %{_bindir}/subunit-notify-2
-%attr(755,root,root) %{_bindir}/subunit-output-2
-%attr(755,root,root) %{_bindir}/subunit-stats-2
-%attr(755,root,root) %{_bindir}/subunit-tags-2
-%attr(755,root,root) %{_bindir}/subunit2csv-2
-%attr(755,root,root) %{_bindir}/subunit2disk-2
-%attr(755,root,root) %{_bindir}/subunit2gtk-2
-%attr(755,root,root) %{_bindir}/subunit2junitxml-2
-%attr(755,root,root) %{_bindir}/subunit2pyunit-2
-%attr(755,root,root) %{_bindir}/tap2subunit-2
-%endif
-
-%if %{with python3}
-%files -n python3-subunit
-%defattr(644,root,root,755)
-%doc NEWS README.rst
 %{py3_sitescriptdir}/subunit
 %{py3_sitescriptdir}/python_subunit-%{version}-py*.egg-info
 
@@ -216,7 +115,6 @@ rm -rf $RPM_BUILD_ROOT
 %attr(755,root,root) %{_bindir}/subunit2junitxml-3
 %attr(755,root,root) %{_bindir}/subunit2pyunit-3
 %attr(755,root,root) %{_bindir}/tap2subunit-3
-%endif
 
 %files -n subunit-python
 %defattr(644,root,root,755)
diff --git a/python-subunit-tests.patch b/python-subunit-tests.patch
index c2b9ca3..6c9fbfa 100644
--- a/python-subunit-tests.patch
+++ b/python-subunit-tests.patch
@@ -1,18 +1,17 @@
 Disable test_test_protocol2, which depends on testtools own test suite.
-Don't require unittest2 on python 3.5+.
-Adjust some traceback quirks for (python3 or not unittest2???)
 
---- python-subunit-1.3.0/python/subunit/tests/__init__.py.orig	2018-07-27 17:10:42.361296016 +0200
-+++ python-subunit-1.3.0/python/subunit/tests/__init__.py	2018-07-27 17:10:56.404629189 +0200
-@@ -40,7 +40,6 @@
-     test_subunit_tags,
-     test_tap2subunit,
-     test_test_protocol,
--    test_test_protocol2,
-     test_test_results,
-     )
- 
-@@ -53,7 +52,6 @@
+--- python-subunit-1.4.3/python/subunit/tests/__init__.py.orig	2023-09-17 14:40:32.000000000 +0200
++++ python-subunit-1.4.3/python/subunit/tests/__init__.py	2023-09-29 06:12:29.112435057 +0200
+@@ -31,7 +31,7 @@ from subunit.tests import (test_chunked,
+                            test_progress_model, test_run, test_subunit_filter,
+                            test_subunit_stats, test_subunit_tags,
+                            test_tap2subunit, test_test_protocol,
+-                           test_test_protocol2, test_test_results)
++                           test_test_results)
+ 
+ 
+ def test_suite():
+@@ -42,7 +42,6 @@ def test_suite():
      result.addTest(loader.loadTestsFromModule(test_progress_model))
      result.addTest(loader.loadTestsFromModule(test_test_results))
      result.addTest(loader.loadTestsFromModule(test_test_protocol))
@@ -20,43 +19,3 @@ Adjust some traceback quirks for (python3 or not unittest2???)
      result.addTest(loader.loadTestsFromModule(test_tap2subunit))
      result.addTest(loader.loadTestsFromModule(test_filter_to_disk))
      result.addTest(loader.loadTestsFromModule(test_subunit_filter))
---- python-subunit-1.3.0/python/subunit/tests/test_test_protocol.py.orig	2018-07-27 17:16:40.051291931 +0200
-+++ python-subunit-1.3.0/python/subunit/tests/test_test_protocol.py	2018-07-27 17:16:42.897958565 +0200
-@@ -16,7 +16,10 @@
- 
- import datetime
- import io
--import unittest2 as unittest
-+try:
-+    import unittest2 as unittest
-+except ImportError:
-+    import unittest
- import os
- import sys
- import tempfile
---- python-subunit-1.3.0/python/subunit/tests/__init__.py.orig	2018-07-27 18:09:57.424588755 +0200
-+++ python-subunit-1.3.0/python/subunit/tests/__init__.py	2018-07-29 12:02:31.736200742 +0200
-@@ -22,9 +22,10 @@
- 
- # Before the test module imports to avoid circularity.
- # For testing: different pythons have different str() implementations.
-+tb_prelude = "Traceback (most recent call last):\n" if ((sys.version_info[0] < 3) or (sys.version_info[0:2] >= [3, 8])) else ""
- _remote_exception_repr = "testtools.testresult.real._StringException"
--_remote_exception_str = "Traceback (most recent call last):\ntesttools.testresult.real._StringException"
--_remote_exception_str_chunked = "57\r\n" + _remote_exception_str + ": boo qux\n0\r\n"
-+_remote_exception_str = tb_prelude + "testtools.testresult.real._StringException"
-+_remote_exception_str_chunked = ("%X" % (42+10+len(tb_prelude))) + "\r\n" + _remote_exception_str + ": boo qux\n0\r\n"
- 
- 
- from subunit.tests import (
---- python-subunit-1.3.0/python/subunit/tests/test_test_protocol.py.orig	2018-07-29 12:02:58.076200443 +0200
-+++ python-subunit-1.3.0/python/subunit/tests/test_test_protocol.py	2018-07-29 12:03:04.769533698 +0200
-@@ -51,7 +51,7 @@
- import subunit.iso8601 as iso8601
- 
- 
--tb_prelude = "Traceback (most recent call last):\n" 
-+from subunit.tests import tb_prelude   # tb_prelude = "Traceback (most recent call last):\n" if sys.version_info[0] < 3 else ""
- 
- 
- def details_to_str(details):
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python3-subunit.git/commitdiff/0b86a8f2582d2c0b0c5b3f74886737ebe79c063b



More information about the pld-cvs-commit mailing list