[packages/python3-testtools] - python-testtools.spec updated to 2.7.2 for python 3.8+
qboosh
qboosh at pld-linux.org
Mon May 26 20:39:16 CEST 2025
commit 237ae2e37c99570ad7385b6240af21fa0c57ac36
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Mon May 26 20:27:56 2025 +0200
- python-testtools.spec updated to 2.7.2 for python 3.8+
python-testtools-deps.patch | 124 ----------------------
python-testtools-tests-nosource.patch | 15 ---
python-testtools.spec | 188 ----------------------------------
python3-testtools.spec | 108 +++++++++++++++++++
4 files changed, 108 insertions(+), 327 deletions(-)
---
diff --git a/python-testtools.spec b/python-testtools.spec
deleted file mode 100644
index 9e9a75e..0000000
--- a/python-testtools.spec
+++ /dev/null
@@ -1,188 +0,0 @@
-#
-# Conditional build:
-%bcond_without doc # HTML (sphinx-based) documentation
-%bcond_without python2 # CPython 2.x module
-%bcond_without python3 # CPython 3.x module
-%bcond_without tests # do not perform tests
-
-Summary: Extensions to the Python unit testing framework
-Summary(pl.UTF-8): Rozszerzenie szkieletu testów jednostkowych Pythona
-Name: python-testtools
-# keep 2.4.x here for python2 support
-Version: 2.4.0
-Release: 5
-License: MIT
-Group: Development/Tools
-#Source0Download: https://pypi.org/simple/testtools/
-Source0: https://files.pythonhosted.org/packages/source/t/testtools/testtools-%{version}.tar.gz
-# Source0-md5: e8fc7185b47cfb908c641f8c4b2a6add
-Patch0: %{name}-tests-nosource.patch
-Patch1: %{name}-deps.patch
-URL: https://github.com/testing-cabal/testtools
-%if %{with python2}
-BuildRequires: python-devel >= 1:2.7
-BuildRequires: python-pbr >= 0.11
-BuildRequires: python-setuptools
-%if %{with tests}
-BuildRequires: python-devel-tools >= 1:2.7
-BuildRequires: python-extras >= 1.0.0
-BuildRequires: python-fixtures >= 1.3.0
-BuildRequires: python-mimeparse
-BuildRequires: python-modules
-BuildRequires: python-six >= 1.4.0
-BuildRequires: python-testresources
-BuildRequires: python-testscenarios
-BuildRequires: python-traceback2
-BuildRequires: python-unittest2 >= 1.0.0
-%endif
-%endif
-%if %{with python3}
-BuildRequires: python3-devel >= 1:3.3
-BuildRequires: python3-pbr >= 0.11
-BuildRequires: python3-setuptools
-%if %{with tests}
-BuildRequires: python3-devel-tools >= 1:3.3
-BuildRequires: python3-extras >= 1.0.0
-BuildRequires: python3-fixtures >= 1.3.0
-BuildRequires: python3-mimeparse
-BuildRequires: python3-six >= 1.4.0
-BuildRequires: python3-testresources
-BuildRequires: python3-testscenarios
-%if "%{py3_ver}" < "3.5"
-BuildRequires: python3-traceback2
-BuildRequires: python3-unittest2 >= 1.0.0
-%endif
-%endif
-%endif
-BuildRequires: rpmbuild(macros) >= 1.714
-BuildRequires: sed >= 4.0
-%{?with_doc:BuildRequires: sphinx-pdg}
-BuildArch: noarch
-BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
-
-%description
-testtools is a set of extensions to the Python standard library's unit
-testing framework.
-
-%description -l pl.UTF-8
-testtools to zestaw rozszerzeń szkieletu testów jednostkowych z
-biblioteki standardowej Pythona.
-
-%package -n python3-testtools
-Summary: Extensions to the Python unit testing framework
-Summary(pl.UTF-8): Rozszerzenie szkieletu testów jednostkowych Pythona
-Group: Development/Tools
-
-%description -n python3-testtools
-testtools is a set of extensions to the Python standard library's unit
-testing framework.
-
-%description -n python3-testtools -l pl.UTF-8
-testtools to zestaw rozszerzeń szkieletu testów jednostkowych z
-biblioteki standardowej Pythona.
-
-%package doc
-Summary: Documentation for Python testttools module
-Summary(pl.UTF-8): Dokumentacja do pakietu Pythona testttools
-Group: Documentation
-Requires: %{name} = %{version}-%{release}
-
-%description doc
-This package contains HTML documentation for Python testttools module.
-
-%description doc -l pl.UTF-8
-Dokumentacja HTML do pakietu Pythona testttools.
-
-%prep
-%setup -q -n testtools-%{version}
-%patch -P 0 -p1
-%patch -P 1 -p1
-
-%build
-%if %{with python2}
-%py_build
-
-%if %{with tests}
-PYTHONPATH=$(pwd) \
-%{__python} -m testtools.run testtools.tests.test_suite
-%endif
-%endif
-
-%if %{with python3}
-%py3_build
-
-%if %{with tests}
-PYTHONPATH=$(pwd) \
-%{__python3} -m testtools.run testtools.tests.test_suite
-%endif
-%endif
-
-%if %{with doc}
-%{__make} -C doc html
-%endif
-
-%install
-rm -rf $RPM_BUILD_ROOT
-
-%if %{with python2}
-%py_install
-
-%{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/testtools/tests/{matchers,twistedsupport}
-%{__rm} $RPM_BUILD_ROOT%{py_sitescriptdir}/testtools/tests/{__init__,samplecases,test_*}.py*
-
-# replace selftests __init__ by empty stub
-touch $RPM_BUILD_ROOT%{py_sitescriptdir}/testtools/tests/__init__.py
-%py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}/testtools/tests
-%py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}/testtools/tests
-
-%py_postclean
-%endif
-
-%if %{with python3}
-%py3_install
-
-%{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/testtools/tests/{matchers,twistedsupport}
-%{__rm} $RPM_BUILD_ROOT%{py3_sitescriptdir}/testtools/tests/{__init__,samplecases,test_*}.py* \
- $RPM_BUILD_ROOT%{py3_sitescriptdir}/testtools/tests/__pycache__/{__init__,samplecases,test_*}.*.py*
-
-# replace selftests __init__ by empty stub
-touch $RPM_BUILD_ROOT%{py3_sitescriptdir}/testtools/tests/__init__.py
-%py3_comp $RPM_BUILD_ROOT%{py3_sitescriptdir}/testtools/tests
-%py3_ocomp $RPM_BUILD_ROOT%{py3_sitescriptdir}/testtools/tests
-%endif
-
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-%if %{with python2}
-%files
-%defattr(644,root,root,755)
-%doc AUTHORS ChangeLog LICENSE NEWS README.rst
-%dir %{py_sitescriptdir}/testtools
-%{py_sitescriptdir}/testtools/*.py[co]
-%{py_sitescriptdir}/testtools/matchers
-%{py_sitescriptdir}/testtools/testresult
-%{py_sitescriptdir}/testtools/tests
-%{py_sitescriptdir}/testtools/twistedsupport
-%{py_sitescriptdir}/testtools-%{version}-py*.egg-info
-%endif
-
-%if %{with python3}
-%files -n python3-testtools
-%defattr(644,root,root,755)
-%doc AUTHORS ChangeLog LICENSE NEWS README.rst
-%dir %{py3_sitescriptdir}/testtools
-%{py3_sitescriptdir}/testtools/*.py
-%{py3_sitescriptdir}/testtools/__pycache__
-%{py3_sitescriptdir}/testtools/matchers
-%{py3_sitescriptdir}/testtools/testresult
-%{py3_sitescriptdir}/testtools/tests
-%{py3_sitescriptdir}/testtools/twistedsupport
-%{py3_sitescriptdir}/testtools-%{version}-py*.egg-info
-%endif
-
-%if %{with doc}
-%files doc
-%defattr(644,root,root,755)
-%doc doc/_build/html/*
-%endif
diff --git a/python3-testtools.spec b/python3-testtools.spec
new file mode 100644
index 0000000..c880af9
--- /dev/null
+++ b/python3-testtools.spec
@@ -0,0 +1,108 @@
+#
+# Conditional build:
+%bcond_without doc # HTML (sphinx-based) documentation
+%bcond_without tests # test suite
+
+Summary: Extensions to the Python unit testing framework
+Summary(pl.UTF-8): Rozszerzenie szkieletu testów jednostkowych Pythona
+Name: python3-testtools
+Version: 2.7.2
+Release: 1
+License: MIT
+Group: Development/Tools
+#Source0Download: https://pypi.org/simple/testtools/
+Source0: https://files.pythonhosted.org/packages/source/t/testtools/testtools-%{version}.tar.gz
+# Source0-md5: 35777a93ea85b59160380595b8cf315e
+URL: https://github.com/testing-cabal/testtools
+BuildRequires: python3-build
+BuildRequires: python3-devel >= 1:3.8
+BuildRequires: python3-hatch-vcs
+BuildRequires: python3-hatchling
+BuildRequires: python3-installer
+BuildRequires: python3-setuptools >= 1:61
+%if %{with tests}
+BuildRequires: python3-devel-tools >= 1:3.8
+BuildRequires: python3-fixtures >= 2.0
+BuildRequires: python3-testresources
+BuildRequires: python3-testscenarios
+%endif
+BuildRequires: rpmbuild(macros) >= 2.044
+%if %{with doc}
+BuildRequires: python3-fixtures >= 2.0
+BuildRequires: sphinx-pdg-3
+%endif
+BuildArch: noarch
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+testtools is a set of extensions to the Python standard library's unit
+testing framework.
+
+%description -l pl.UTF-8
+testtools to zestaw rozszerzeń szkieletu testów jednostkowych z
+biblioteki standardowej Pythona.
+
+%package doc
+Summary: Documentation for Python testttools module
+Summary(pl.UTF-8): Dokumentacja do pakietu Pythona testttools
+Group: Documentation
+Requires: %{name} = %{version}-%{release}
+
+%description doc
+This package contains HTML documentation for Python testttools module.
+
+%description doc -l pl.UTF-8
+Dokumentacja HTML do pakietu Pythona testttools.
+
+%prep
+%setup -q -n testtools-%{version}
+
+%build
+# setup.py exists, but only hatching build stores proper version information
+%py3_build_pyproject
+
+%if %{with tests}
+PYTHONPATH=$(pwd) \
+%{__python3} -m testtools.run testtools.tests.test_suite
+%endif
+
+%if %{with doc}
+PYTHONPATH=$(pwd) \
+%{__make} -C doc html \
+ SPHINXBUILD=sphinx-build-3
+%endif
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%py3_install_pyproject
+
+%{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/testtools/tests/{matchers,twistedsupport}
+%{__rm} $RPM_BUILD_ROOT%{py3_sitescriptdir}/testtools/tests/{__init__,samplecases,test_*}.py* \
+ $RPM_BUILD_ROOT%{py3_sitescriptdir}/testtools/tests/__pycache__/{__init__,samplecases,test_*}.*.py*
+
+# replace selftests __init__ by empty stub
+touch $RPM_BUILD_ROOT%{py3_sitescriptdir}/testtools/tests/__init__.py
+%py3_comp $RPM_BUILD_ROOT%{py3_sitescriptdir}/testtools/tests
+%py3_ocomp $RPM_BUILD_ROOT%{py3_sitescriptdir}/testtools/tests
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(644,root,root,755)
+%doc LICENSE NEWS README.rst
+%dir %{py3_sitescriptdir}/testtools
+%{py3_sitescriptdir}/testtools/*.py
+%{py3_sitescriptdir}/testtools/__pycache__
+%{py3_sitescriptdir}/testtools/matchers
+%{py3_sitescriptdir}/testtools/testresult
+%{py3_sitescriptdir}/testtools/tests
+%{py3_sitescriptdir}/testtools/twistedsupport
+%{py3_sitescriptdir}/testtools-%{version}.dist-info
+
+%if %{with doc}
+%files doc
+%defattr(644,root,root,755)
+%doc doc/_build/html/{_static,*.html,*.js}
+%endif
diff --git a/python-testtools-deps.patch b/python-testtools-deps.patch
deleted file mode 100644
index 096a119..0000000
--- a/python-testtools-deps.patch
+++ /dev/null
@@ -1,124 +0,0 @@
---- testtools-2.3.0/testtools/compat.py.orig 2016-10-22 19:21:40.000000000 +0200
-+++ testtools-2.3.0/testtools/compat.py 2018-07-25 20:13:12.616477384 +0200
-@@ -23,7 +23,6 @@
- import os
- import re
- import sys
--import traceback
- import unicodedata
-
- from extras import try_import, try_imports
-@@ -31,7 +30,8 @@
- BytesIO = try_imports(['StringIO.StringIO', 'io.BytesIO'])
- StringIO = try_imports(['StringIO.StringIO', 'io.StringIO'])
- # To let setup.py work, make this a conditional import.
--linecache = try_import('linecache2')
-+linecache = try_imports(['linecache2', 'linecache'])
-+traceback = try_imports(['traceback2', 'traceback'])
-
- try:
- from testtools import _compat2x as _compat
---- testtools-2.3.0/testtools/content.py.orig 2018-07-25 20:42:06.519790918 +0200
-+++ testtools-2.3.0/testtools/content.py 2018-07-25 20:42:17.726457457 +0200
-@@ -20,7 +20,7 @@
-
--from extras import try_import
-+from extras import try_import, try_imports
- # To let setup.py work, make this a conditional import.
--traceback = try_import('traceback2')
-+traceback = try_imports(['traceback2', 'traceback'])
-
- from testtools.compat import (
- _b,
---- testtools-2.3.0/requirements.txt.orig 2016-10-22 19:21:40.000000000 +0200
-+++ testtools-2.3.0/requirements.txt 2018-07-25 20:43:58.353122975 +0200
-@@ -4,6 +4,6 @@
- # 'mimeparse' has not been uploaded by the maintainer with Python3 compat
- # but someone kindly uploaded a fixed version as 'python-mimeparse'.
- python-mimeparse
--unittest2>=1.0.0
--traceback2
-+unittest2>=1.0.0; python_version<"3.5"
-+traceback2; python_version<"3.5"
- six>=1.4.0
---- testtools-2.3.0/testtools/tests/test_testsuite.py.orig 2018-07-25 20:46:29.929787912 +0200
-+++ testtools-2.3.0/testtools/tests/test_testsuite.py 2018-07-25 20:46:33.316454540 +0200
-@@ -5,9 +5,9 @@
- import doctest
- from pprint import pformat
- import unittest
--import unittest2
-
--from extras import try_import
-+from extras import try_import, try_imports
-+unittest2 = try_imports(['unittest2', 'unittest'])
-
- from testtools import (
- ConcurrentTestSuite,
---- testtools-2.3.0/testtools/tests/test_run.py.orig 2016-10-22 19:21:40.000000000 +0200
-+++ testtools-2.3.0/testtools/tests/test_run.py 2018-07-25 20:50:49.796451611 +0200
-@@ -7,10 +7,10 @@
- import sys
- from textwrap import dedent
-
--from extras import try_import
-+from extras import try_import, try_imports
- fixtures = try_import('fixtures')
- testresources = try_import('testresources')
--import unittest2
-+unittest2 = try_imports(['unittest2', 'unittest'])
-
- import testtools
- from testtools import TestCase, run, skipUnless
---- testtools-2.3.0/testtools/tests/twistedsupport/test_deferred.py.orig 2016-10-22 19:21:40.000000000 +0200
-+++ testtools-2.3.0/testtools/tests/twistedsupport/test_deferred.py 2018-07-25 20:51:43.476450997 +0200
-@@ -52,5 +52,8 @@
-
-
- def test_suite():
-- from unittest2 import TestLoader, TestSuite
-+ try:
-+ from unittest2 import TestLoader, TestSuite
-+ except ImportError:
-+ from unittest import TestLoader, TestSuite
- return TestLoader().loadTestsFromName(__name__)
---- testtools-2.3.0/testtools/tests/twistedsupport/test_matchers.py.orig 2016-10-22 19:21:40.000000000 +0200
-+++ testtools-2.3.0/testtools/tests/twistedsupport/test_matchers.py 2018-07-25 21:06:30.283107538 +0200
-@@ -205,5 +205,8 @@
-
-
- def test_suite():
-- from unittest2 import TestLoader, TestSuite
-+ try:
-+ from unittest2 import TestLoader, TestSuite
-+ except ImportError:
-+ from unittest import TestLoader, TestSuite
- return TestLoader().loadTestsFromName(__name__)
---- testtools-2.3.0/testtools/tests/twistedsupport/test_runtest.py.orig 2016-10-22 19:21:40.000000000 +0200
-+++ testtools-2.3.0/testtools/tests/twistedsupport/test_runtest.py 2018-07-25 21:06:50.219773978 +0200
-@@ -1016,7 +1016,10 @@
-
-
- def test_suite():
-- from unittest2 import TestLoader, TestSuite
-+ try:
-+ from unittest2 import TestLoader, TestSuite
-+ except ImportError:
-+ from unittest import TestLoader, TestSuite
- return TestLoader().loadTestsFromName(__name__)
-
-
---- testtools-2.4.0/testtools/tests/test_compat.py.orig 2019-11-28 09:58:29.000000000 +0100
-+++ testtools-2.4.0/testtools/tests/test_compat.py 2022-03-17 18:54:23.676536228 +0100
-@@ -4,7 +4,10 @@
-
- import ast
- import io
--import linecache2 as linecache
-+try:
-+ import linecache2 as linecache
-+except ImportError:
-+ import linecache
- import os
- import sys
- import tempfile
diff --git a/python-testtools-tests-nosource.patch b/python-testtools-tests-nosource.patch
deleted file mode 100644
index 0e9bad5..0000000
--- a/python-testtools-tests-nosource.patch
+++ /dev/null
@@ -1,15 +0,0 @@
---- testtools-2.3.0/testtools/tests/test_run.py.orig 2018-07-26 18:36:38.072223680 +0200
-+++ testtools-2.3.0/testtools/tests/test_run.py 2018-07-26 18:56:54.098876462 +0200
-@@ -204,10 +204,8 @@
- unittest2.loader._FailedTest.runexample
- Failed to import test module: runexample
- Traceback (most recent call last):
-- File ".../loader.py", line ..., in _find_test_path
-- package = self._get_module_from_name(name)
-- File ".../loader.py", line ..., in _get_module_from_name
-- __import__(name)
-+ File ".../loader.py", line ..., in _find_test_path...
-+ File ".../loader.py", line ..., in _get_module_from_name...
- File ".../runexample/__init__.py", line 1
- class not in
- ...^...
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/python3-testtools.git/commitdiff/237ae2e37c99570ad7385b6240af21fa0c57ac36
More information about the pld-cvs-commit
mailing list