[packages/python3-sure] - python-sure.spec updated to 2.0.1 for python 3.4+

qboosh qboosh at pld-linux.org
Sun Mar 8 15:00:05 CET 2026


commit 0bc521ad3911dcbc3a8365e8c1bf294b15004927
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sun Mar 8 15:00:07 2026 +0100

    - python-sure.spec updated to 2.0.1 for python 3.4+

 python-sure-mock.patch                  |  65 -----------------
 python-sure-python3.10-workaround.patch |  19 -----
 python-sure.spec                        | 123 --------------------------------
 python3-sure.spec                       |  69 ++++++++++++++++++
 sure-mock.patch                         |  37 ++++++++++
 sure-nose.patch                         |  11 +++
 6 files changed, 117 insertions(+), 207 deletions(-)
---
diff --git a/python-sure.spec b/python-sure.spec
deleted file mode 100644
index 2541949..0000000
--- a/python-sure.spec
+++ /dev/null
@@ -1,123 +0,0 @@
-# NOTE: sure.cli and sure.stubs are python3-only
-#
-# Conditional build:
-%bcond_without	tests	# unit tests
-%bcond_without	python2 # CPython 2.x module
-%bcond_without	python3 # CPython 3.x module
-
-%define		module		sure
-Summary:	Utility belt for automated testing in Python for Python
-Summary(pl.UTF-8):	Narzędzia do automatycznego testowania w Pythonie
-Name:		python-%{module}
-# keep 2.0.0 here for python2 support
-Version:	2.0.0
-Release:	4
-License:	GPL v3+
-Group:		Libraries/Python
-#Source0Download; https://pypi.org/simple/sure/
-Source0:	https://files.pythonhosted.org/packages/source/s/sure/%{module}-%{version}.tar.gz
-# Source0-md5:	2944861acf83042a291ffb1190a56292
-Patch0:		%{name}-mock.patch
-Patch1:		%{name}-python3.10-workaround.patch
-URL:		https://github.com/gabrielfalcao/sure
-%if %{with python2}
-BuildRequires:	python-devel >= 1:2.7
-BuildRequires:	python-mock >= 2.0.0
-BuildRequires:	python-nose
-BuildRequires:	python-rednose
-BuildRequires:	python-setuptools
-BuildRequires:	python-six >= 1.16.0
-%endif
-%if %{with python3}
-BuildRequires:	python3-devel >= 1:3.4
-BuildRequires:	python3-nose
-BuildRequires:	python3-rednose
-BuildRequires:	python3-setuptools
-BuildRequires:	python3-six >= 1.16.0
-%endif
-BuildRequires:	rpm-pythonprov
-BuildRequires:	rpmbuild(macros) >= 1.714
-Requires:	python-modules >= 1:2.7
-BuildArch:	noarch
-BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
-
-%description
-A testing library for Python with powerful and flexible assertions.
-Sure is heavily inspired by should.js.
-
-%description -l pl.UTF-8
-Biblioteka testów dla Pythona z bardzo elastycznymi asercjami. Sure
-jest znacząco zainspirowany should.js.
-
-%package -n python3-%{module}
-Summary:	Utility belt for automated testing in python for python
-Summary(pl.UTF-8):	Narzędzia do automatycznego testowania w Pythonie
-Group:		Libraries/Python
-Requires:	python3-modules >= 1:3.4
-
-%description -n python3-%{module}
-A testing library for Python with powerful and flexible assertions.
-Sure is heavily inspired by should.js.
-
-%description -n python3-%{module} -l pl.UTF-8
-Biblioteka testów dla Pythona z bardzo elastycznymi asercjami. Sure
-jest znacząco zainspirowany should.js.
-
-%prep
-%setup -q -n %{module}-%{version}
-%patch -P 0 -p1
-%patch -P 1 -p1
-
-%build
-%if %{with python2}
-%py_build %{?with_tests:test}
-%endif
-
-%if %{with python3}
-%py3_build
-
-%if %{with tests}
-# use explicit plugins list for reliable builds (delete PYTEST_PLUGINS if empty)
-PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
-PYTEST_PLUGINS= \
-%{__python3} -m pytest tests
-%endif
-%endif
-
-%install
-rm -rf $RPM_BUILD_ROOT
-
-%if %{with python2}
-%py_install
-
-# sure.cli is python3-only (uses f"..." syntax), so this entry point is invalid
-%{__rm} $RPM_BUILD_ROOT%{_bindir}/sure
-
-%py_postclean
-%endif
-
-%if %{with python3}
-%py3_install
-
-%{__mv} $RPM_BUILD_ROOT%{_bindir}/sure{,-3}
-%endif
-
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-%if %{with python2}
-%files
-%defattr(644,root,root,755)
-%doc README.rst
-%{py_sitescriptdir}/sure
-%{py_sitescriptdir}/sure-%{version}-py*.egg-info
-%endif
-
-%if %{with python3}
-%files -n python3-%{module}
-%defattr(644,root,root,755)
-%doc README.rst
-%attr(755,root,root) %{_bindir}/sure-3
-%{py3_sitescriptdir}/sure
-%{py3_sitescriptdir}/sure-%{version}-py*.egg-info
-%endif
diff --git a/python3-sure.spec b/python3-sure.spec
new file mode 100644
index 0000000..aa865c6
--- /dev/null
+++ b/python3-sure.spec
@@ -0,0 +1,69 @@
+#
+# Conditional build:
+%bcond_without	tests	# unit tests
+
+%define		module		sure
+Summary:	Utility belt for automated testing in Python for Python
+Summary(pl.UTF-8):	Narzędzia do automatycznego testowania w Pythonie
+Name:		python3-sure
+Version:	2.0.1
+Release:	1
+License:	GPL v3+
+Group:		Libraries/Python
+#Source0Download; https://pypi.org/simple/sure/
+Source0:	https://files.pythonhosted.org/packages/source/s/sure/%{module}-%{version}.tar.gz
+# Source0-md5:	ec12c1e6a50cfac8dbe119943a4ddc6f
+Patch0:		sure-mock.patch
+Patch1:		sure-nose.patch
+URL:		https://github.com/gabrielfalcao/sure
+BuildRequires:	python3-devel >= 1:3.4
+BuildRequires:	python3-setuptools
+BuildRequires:	python3-six >= 1.16.0
+%if %{with tests}
+BuildRequires:	python3-pynose
+BuildRequires:	python3-rednose
+%endif
+BuildRequires:	rpm-pythonprov
+BuildRequires:	rpmbuild(macros) >= 1.714
+Requires:	python3-modules >= 1:3.4
+BuildArch:	noarch
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+A testing library for Python with powerful and flexible assertions.
+Sure is heavily inspired by should.js.
+
+%description -l pl.UTF-8
+Biblioteka testów dla Pythona z bardzo elastycznymi asercjami. Sure
+jest znacząco zainspirowany should.js.
+
+%prep
+%setup -q -n %{module}-%{version}
+%patch -P0 -p1
+%patch -P1 -p1
+
+%build
+%py3_build
+
+%if %{with tests}
+nosetests-%{py3_ver} tests
+%endif
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%py3_install
+
+%{__mv} $RPM_BUILD_ROOT%{_bindir}/sure{,-3}
+ln -sf sure-3 $RPM_BUILD_ROOT%{_bindir}/sure
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(644,root,root,755)
+%doc README.rst
+%attr(755,root,root) %{_bindir}/sure-3
+%{_bindir}/sure
+%{py3_sitescriptdir}/sure
+%{py3_sitescriptdir}/sure-%{version}-py*.egg-info
diff --git a/python-sure-mock.patch b/python-sure-mock.patch
deleted file mode 100644
index 71160ce..0000000
--- a/python-sure-mock.patch
+++ /dev/null
@@ -1,65 +0,0 @@
---- sure-2.0.0/setup.py.orig	2018-05-16 23:37:56.000000000 +0200
-+++ sure-2.0.0/setup.py	2020-06-06 07:54:38.467908573 +0200
-@@ -81,7 +81,7 @@
-         return __doc__
- 
- 
--install_requires = ["mock", "six"]
-+install_requires = ['mock;python_version<"3"', "six"]
- tests_require = ["nose"]
- version = read_version()
- 
---- sure-1.4.11/sure/core.py.orig	2018-03-17 23:31:48.000000000 +0100
-+++ sure-1.4.11/sure/core.py	2020-06-06 07:56:27.183986275 +0200
-@@ -19,9 +19,12 @@
- import os
- 
- try:
--    from mock import _CallList
-+    from unittest.mock import _CallList
- except ImportError:
--    from mock.mock import _CallList
-+    try:
-+        from mock import _CallList
-+    except ImportError:
-+        from mock.mock import _CallList
- 
- import inspect
- from six import (
---- sure-1.4.11/tests/test_assertion_builder.py.orig	2017-03-20 14:51:42.000000000 +0100
-+++ sure-1.4.11/tests/test_assertion_builder.py	2020-06-06 07:58:55.016518731 +0200
-@@ -17,7 +17,10 @@
- # along with this program.  If not, see <http://www.gnu.org/licenses/>.
- from __future__ import unicode_literals
- import re
--import mock
-+try:
-+    from unittest import mock
-+except ImportError:
-+    import mock
- from collections import OrderedDict
- 
- from datetime import datetime, timedelta
-@@ -654,18 +654,18 @@
- 
-     except AssertionError as e:
-         if PY2:
--            expect(str(e)).to.equal("When calling 'blah [tests/test_assertion_builder.py line 635]' the exception message does not match. Expected to match regex: u'invalid regex'\n against:\n u'this message'")
-+            expect(str(e)).to.equal("When calling 'blah [tests/test_assertion_builder.py line 638]' the exception message does not match. Expected to match regex: u'invalid regex'\n against:\n u'this message'")
-         else:
--            expect(str(e)).to.equal("When calling b'blah [tests/test_assertion_builder.py line 635]' the exception message does not match. Expected to match regex: 'invalid regex'\n against:\n 'this message'")
-+            expect(str(e)).to.equal("When calling b'blah [tests/test_assertion_builder.py line 638]' the exception message does not match. Expected to match regex: 'invalid regex'\n against:\n 'this message'")
- 
-     try:
-         expect(blah).when.called_with(1).should.throw(ValueError, re.compile(r'invalid regex'))
-         raise RuntimeError('should not have reached here')
-     except AssertionError as e:
-         if PY2:
--            expect(str(e)).to.equal("When calling 'blah [tests/test_assertion_builder.py line 635]' the exception message does not match. Expected to match regex: u'invalid regex'\n against:\n u'this message'")
-+            expect(str(e)).to.equal("When calling 'blah [tests/test_assertion_builder.py line 638]' the exception message does not match. Expected to match regex: u'invalid regex'\n against:\n u'this message'")
-         else:
--            expect(str(e)).to.equal("When calling b'blah [tests/test_assertion_builder.py line 635]' the exception message does not match. Expected to match regex: 'invalid regex'\n against:\n 'this message'")
-+            expect(str(e)).to.equal("When calling b'blah [tests/test_assertion_builder.py line 638]' the exception message does not match. Expected to match regex: 'invalid regex'\n against:\n 'this message'")
- 
- def test_should_not_be_different():
-     ("'something'.should_not.be.different('SOMETHING'.lower())")
diff --git a/python-sure-python3.10-workaround.patch b/python-sure-python3.10-workaround.patch
deleted file mode 100644
index 9191bab..0000000
--- a/python-sure-python3.10-workaround.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-diff --git a/tests/test_old_api.py b/tests/test_old_api.py
-index d63d8fe..2f93bc5 100644
---- a/tests/test_old_api.py
-+++ b/tests/test_old_api.py
-@@ -57,10 +57,10 @@ def test_context_is_not_optional():
-         assert True
- 
-     assert that(it_crashes).raises(
--        TypeError, (
--        "the function it_crashes defined at test_old_api.py line 56, is being "
--        "decorated by either @that_with_context or @scenario, so it should "
--        "take at least 1 parameter, which is the test context"),
-+        TypeError,
-+        # intentionally empty line 1
-+        # intentionally empty line 2
-+        # intentionally empty line 3
-     )
- 
- 
diff --git a/sure-mock.patch b/sure-mock.patch
new file mode 100644
index 0000000..e0fa405
--- /dev/null
+++ b/sure-mock.patch
@@ -0,0 +1,37 @@
+--- sure-2.0.1/setup.py.orig	2023-02-06 12:57:54.000000000 +0100
++++ sure-2.0.1/setup.py	2026-03-08 14:10:01.341594111 +0100
+@@ -81,7 +81,7 @@ def read_readme():
+         return __doc__
+ 
+ 
+-install_requires = ["mock", "six"]
++install_requires = ["six"]
+ tests_require = ["nose"]
+ version = read_version()
+ 
+--- sure-2.0.1/sure/core.py.orig	2026-03-08 14:48:00.552579899 +0100
++++ sure-2.0.1/sure/core.py	2026-03-08 14:48:03.569230223 +0100
+@@ -18,10 +18,7 @@ from __future__ import unicode_literals
+ 
+ import os
+ 
+-try:
+-    from mock import _CallList
+-except ImportError:
+-    from mock.mock import _CallList
++from unittest.mock import _CallList
+ 
+ import inspect
+ from six import (
+--- sure-2.0.1/tests/test_assertion_builder.py.orig	2023-02-05 07:34:30.000000000 +0100
++++ sure-2.0.1/tests/test_assertion_builder.py	2026-03-08 14:48:48.122322191 +0100
+@@ -17,8 +17,8 @@
+ # along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ from __future__ import unicode_literals
+ import re
+-import mock
+ from collections import OrderedDict
++from unittest import mock
+ 
+ from datetime import datetime, timedelta
+ from sure import this, these, those, it, expect, anything, AssertionBuilder
diff --git a/sure-nose.patch b/sure-nose.patch
new file mode 100644
index 0000000..ed80b87
--- /dev/null
+++ b/sure-nose.patch
@@ -0,0 +1,11 @@
+--- sure-2.0.1/tests/test_old_api.py.orig	2023-02-05 07:34:30.000000000 +0100
++++ sure-2.0.1/tests/test_old_api.py	2026-03-08 14:52:51.267671626 +0100
+@@ -24,7 +24,7 @@ import sure
+ from sure.deprecated import that
+ from sure.magic import is_cpython
+ from sure import VariablesBag, expect
+-from nose.tools import assert_equals, assert_raises
++from nose.tools import assert_equal as assert_equals, assert_raises
+ from sure.compat import compat_repr, safe_repr, text_type_name
+ 
+ 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python3-sure.git/commitdiff/0bc521ad3911dcbc3a8365e8c1bf294b15004927



More information about the pld-cvs-commit mailing list