diff --git a/backport-Don-t-recommend-import-form.patch b/backport-Don-t-recommend-import-form.patch new file mode 100644 index 0000000000000000000000000000000000000000..8c22afc7c0e4686f7b2cdd19dbe2b62740fdcf56 --- /dev/null +++ b/backport-Don-t-recommend-import-form.patch @@ -0,0 +1,34 @@ +From dc71284de69e06084689e81a720bf40d150e0aa6 Mon Sep 17 00:00:00 2001 +From: Simon Brunning +Date: Thu, 3 Mar 2022 06:37:51 +0000 +Subject: [PATCH] Don't recommend "import *" form. + +--- + README.rst | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/README.rst b/README.rst +index 9be6c1b..55f6a51 100644 +--- a/README.rst ++++ b/README.rst +@@ -55,7 +55,7 @@ the standard set of matchers: + + .. code:: python + +- from hamcrest import * ++ from hamcrest import assert_that, equal_to + import unittest + + +@@ -266,7 +266,7 @@ could use it in our test by importing the factory function ``on_a_saturday``: + + .. code:: python + +- from hamcrest import * ++ from hamcrest import assert_that, is_ + import unittest + from isgivendayofweek import on_a_saturday + +-- +2.9.3.windows.1 + diff --git a/backport-chore-Add-missing-__all__-to-library-submodules.patch b/backport-chore-Add-missing-__all__-to-library-submodules.patch new file mode 100644 index 0000000000000000000000000000000000000000..8535d1420ab1e92314b05f2de500ddf0a6915348 --- /dev/null +++ b/backport-chore-Add-missing-__all__-to-library-submodules.patch @@ -0,0 +1,74 @@ +From 121337b65945e8de17c2b76e714dc2c76b885c8a Mon Sep 17 00:00:00 2001 +From: Serg Tereshchenko +Date: Mon, 13 Dec 2021 15:41:37 +0200 +Subject: [PATCH] chore: Add missing __all__ to library submodules + +--- + src/hamcrest/library/integration/__init__.py | 2 ++ + src/hamcrest/library/number/__init__.py | 8 ++++++++ + src/hamcrest/library/object/__init__.py | 7 +++++++ + src/hamcrest/library/text/__init__.py | 10 ++++++++++ + 4 files changed, 27 insertions(+) + +diff --git a/src/hamcrest/library/integration/__init__.py b/src/hamcrest/library/integration/__init__.py +index b28371c..e87d6e1 100644 +--- a/src/hamcrest/library/integration/__init__.py ++++ b/src/hamcrest/library/integration/__init__.py +@@ -5,3 +5,5 @@ from .match_equality import match_equality + __author__ = "Jon Reid" + __copyright__ = "Copyright 2011 hamcrest.org" + __license__ = "BSD, see License.txt" ++ ++__all__ = ["match_equality"] +diff --git a/src/hamcrest/library/number/__init__.py b/src/hamcrest/library/number/__init__.py +index ca9b151..85f4cf6 100644 +--- a/src/hamcrest/library/number/__init__.py ++++ b/src/hamcrest/library/number/__init__.py +@@ -11,3 +11,11 @@ from .ordering_comparison import ( + __author__ = "Jon Reid" + __copyright__ = "Copyright 2011 hamcrest.org" + __license__ = "BSD, see License.txt" ++ ++__all__ = [ ++ "close_to", ++ "greater_than", ++ "greater_than_or_equal_to", ++ "less_than", ++ "less_than_or_equal_to", ++] +diff --git a/src/hamcrest/library/object/__init__.py b/src/hamcrest/library/object/__init__.py +index af84d7e..e015671 100644 +--- a/src/hamcrest/library/object/__init__.py ++++ b/src/hamcrest/library/object/__init__.py +@@ -7,3 +7,10 @@ from .hasstring import has_string + __author__ = "Jon Reid" + __copyright__ = "Copyright 2011 hamcrest.org" + __license__ = "BSD, see License.txt" ++ ++__all__ = [ ++ "has_length", ++ "has_properties", ++ "has_property", ++ "has_string", ++] +diff --git a/src/hamcrest/library/text/__init__.py b/src/hamcrest/library/text/__init__.py +index 291ac31..19e46c4 100644 +--- a/src/hamcrest/library/text/__init__.py ++++ b/src/hamcrest/library/text/__init__.py +@@ -11,3 +11,13 @@ from .stringstartswith import starts_with + __author__ = "Jon Reid" + __copyright__ = "Copyright 2011 hamcrest.org" + __license__ = "BSD, see License.txt" ++ ++__all__ = [ ++ "contains_string", ++ "ends_with", ++ "equal_to_ignoring_case", ++ "equal_to_ignoring_whitespace", ++ "matches_regexp", ++ "starts_with", ++ "string_contains_in_order", ++] +-- +2.9.3.windows.1 + diff --git a/backport-doc-Fix-raises-example.patch b/backport-doc-Fix-raises-example.patch new file mode 100644 index 0000000000000000000000000000000000000000..10dbe2a94aeecf3c076372ceb200ebfab7c1bef4 --- /dev/null +++ b/backport-doc-Fix-raises-example.patch @@ -0,0 +1,25 @@ +From 38048c5dd82f76703ab7f62f23ab68b9d0d6c393 Mon Sep 17 00:00:00 2001 +From: kumy +Date: Mon, 28 Feb 2022 18:21:29 +0100 +Subject: [PATCH] doc: Fix raises example + +--- + doc/tutorial.rst | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/doc/tutorial.rst b/doc/tutorial.rst +index baa3d6d..b8f20aa 100644 +--- a/doc/tutorial.rst ++++ b/doc/tutorial.rst +@@ -81,7 +81,7 @@ assure that the right issue was found:: + + assert_that(calling(parse, bad_data), raises(ValueError)) + +- assert_that(calling(translate).with_(curse_words), raises(LanguageError, "\w+very naughty")) ++ assert_that(calling(translate).with_args(curse_words), raises(LanguageError, "\w+very naughty")) + + assert_that(broken_function, raises(Exception)) + +-- +2.9.3.windows.1 + diff --git a/python-hamcrest.spec b/python-hamcrest.spec index 97f4fd1792ef3f0cffd4b57f8abfd97b7b40c216..05e60e2cd99cd5e17d383b36d2f27c9670198dbd 100644 --- a/python-hamcrest.spec +++ b/python-hamcrest.spec @@ -1,11 +1,14 @@ Name: python-hamcrest Version: 2.0.3 -Release: 2 +Release: 3 Summary: Hamcrest matchers for Python License: BSD-3-Clause URL: https://github.com/hamcrest/PyHamcrest Source0: https://github.com/hamcrest/PyHamcrest/archive/V2.0.3/%{name}-%{version}.tar.gz Patch0: numpy-1.20.0-alias-depr.patch +Patch1: backport-chore-Add-missing-__all__-to-library-submodules.patch +Patch2: backport-doc-Fix-raises-example.patch +Patch3: backport-Don-t-recommend-import-form.patch BuildArch: noarch %description @@ -47,6 +50,11 @@ PYTHONPATH=%{buildroot}%{python3_sitelib} py.test-%{python3_version} -v %{python3_sitelib}/* %changelog +* Wed May 15 2024 wuzhaomin - 2.0.3-3 +- Add missing __all__ to library submodules +- doc: Fix raises example +- Don't recommend "import *" form. + * Sun Jul 23 2023 wangkai <13474090681@163.com> - 2.0.3-2 - Fix build error for numpy-1.20