diff --git a/fix-mock-assertion.patch b/fix-mock-assertion.patch new file mode 100644 index 0000000..7e749b6 --- /dev/null +++ b/fix-mock-assertion.patch @@ -0,0 +1,35 @@ +From 5d5ca2b57aa49c508950c927eb42d2ffe14c3cf6 Mon Sep 17 00:00:00 2001 +From: Steve Kowalik +Date: Tue, 9 Apr 2024 15:36:24 +1000 +Subject: [PATCH] Fix mock assertion in ICU recipe + +Python 3.12 now does not blindly any methods on mocked objects, which +masks issues. Correct the assertion of has_calls to assert_has_calls in +the ICU recipe. + +Fixes #3002 +--- + tests/recipes/test_icu.py | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/tests/recipes/test_icu.py b/tests/recipes/test_icu.py +index 239b99e4c1..dacf65a0b4 100644 +--- a/tests/recipes/test_icu.py ++++ b/tests/recipes/test_icu.py +@@ -52,13 +52,14 @@ def test_build_arch( + + # We expect some calls to `sh.Command` + build_root = self.recipe.get_build_dir(self.arch.arch) +- mock_sh_command.has_calls( ++ mock_sh_command.assert_has_calls( + [ + mock.call( + os.path.join(build_root, "source", "runConfigureICU") + ), + mock.call(os.path.join(build_root, "source", "configure")), +- ] ++ ], ++ any_order=True + ) + mock_ensure_dir.assert_called() + mock_chdir.assert_called() diff --git a/python-python-for-android.changes b/python-python-for-android.changes index d0a32ef..38ccc08 100644 --- a/python-python-for-android.changes +++ b/python-python-for-android.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Mon Sep 30 06:32:03 UTC 2024 - Steve Kowalik + +- Add patch fix-mock-assertion.patch: + * Correct mock has_calls call. +- Skip recalcitrant test. + ------------------------------------------------------------------- Mon Apr 8 05:32:06 UTC 2024 - Steve Kowalik diff --git a/python-python-for-android.spec b/python-python-for-android.spec index 45dc420..2e5dea4 100644 --- a/python-python-for-android.spec +++ b/python-python-for-android.spec @@ -27,6 +27,8 @@ Source: https://github.com/kivy/python-for-android/archive/refs/tags/v%{ Source1: python-python-for-android-rpmlintrc # PATCH-FIX-OPENSUSE We don't need or want isolation when determining metadata Patch0: no-isolation-for-metadata-build.patch +# PATCH-FIX-UPSTREAM gh#kivy/python-for-android#3003 +Patch1: fix-mock-assertion.patch BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros @@ -34,12 +36,14 @@ Requires: python-Jinja2 Requires: python-appdirs Requires: python-build Requires: python-colorama >= 0.3.3 +Requires: python-packaging +Requires: python-setuptools +Requires: python-sh >= 2 Requires: python-toml Requires(post): update-alternatives Requires(postun): update-alternatives Recommends: cmake Recommends: python-pip -Recommends: python-setuptools Recommends: python-wheel BuildArch: noarch # SECTION test requirements @@ -108,8 +112,8 @@ export PYTHONPATH=${PWD}:${PWD}/tests/ skip_tests="test_get_dep_names_of_package or test_get_package_dependencies or test_venv or test_get_package_as_folder or test_extract_metainfo_files_from_package" # Unable to download NDK skip_tests="$skip_tests or (TestToolchainCL and test_create) or test_create_python_bundle" -# Broken with 3.12 - https://github.com/kivy/python-for-android/issues/3002 -skip_tests="$skip_tests or (TestIcuRecipe and test_build_arch)" +# build_dir is somehow None +skip_tests="$skip_tests or (TestSDL2MixerRecipe and test_get_include_dirs)" %pytest -rs tests -k "not ($skip_tests)" @@ -124,7 +128,7 @@ skip_tests="$skip_tests or (TestIcuRecipe and test_build_arch)" %license LICENSE %python_alternative %{_bindir}/python-for-android %python_alternative %{_bindir}/p4a -%{python_sitelib}/*pythonforandroid*/ -%{python_sitelib}/*python_for_android*/ +%{python_sitelib}/pythonforandroid +%{python_sitelib}/python_for_android-%{version}.dist-info %changelog