From 0dbe49c03c4169543897a3aafeb9de49ac63093c7222fa387be10f3f00f90751 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Wed, 3 Jan 2024 18:52:52 +0000 Subject: [PATCH] Accepting request 1136563 from home:alarrosa:branches:devel:languages:python - Add patch to enable the gmpy test correctly: * enable_gmpy_test.patch - Disable BuildRequies pandas and scikit-learn in SLE where they're not available and only used for tests - Use python-bson instead of python-pymongo in SLE - Do not search for tests recursively in SLE but explicitly name the directory/files containing tests. This solves an issue building the package without pandas in SLE. OBS-URL: https://build.opensuse.org/request/show/1136563 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-jsonpickle?expand=0&rev=30 --- enable_gmpy_test.patch | 12 ++++++++++++ python-jsonpickle.changes | 12 ++++++++++++ python-jsonpickle.spec | 13 +++++++++++-- 3 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 enable_gmpy_test.patch diff --git a/enable_gmpy_test.patch b/enable_gmpy_test.patch new file mode 100644 index 0000000..25f58bb --- /dev/null +++ b/enable_gmpy_test.patch @@ -0,0 +1,12 @@ +Index: jsonpickle-3.0.2/tests/ecdsa_test.py +=================================================================== +--- jsonpickle-3.0.2.orig/tests/ecdsa_test.py ++++ jsonpickle-3.0.2/tests/ecdsa_test.py +@@ -7,6 +7,7 @@ import pytest + from helper import SkippableTest + + import jsonpickle ++import jsonpickle.ext.gmpy + + + @pytest.fixture(scope='module', autouse=True) diff --git a/python-jsonpickle.changes b/python-jsonpickle.changes index 6c53251..286fa16 100644 --- a/python-jsonpickle.changes +++ b/python-jsonpickle.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Fri Dec 29 13:52:24 UTC 2023 - Antonio Larrosa + +- Add patch to enable the gmpy test correctly: + * enable_gmpy_test.patch +- Disable BuildRequies pandas and scikit-learn in SLE where + they're not available and only used for tests +- Use python-bson instead of python-pymongo in SLE +- Do not search for tests recursively in SLE but explicitly name + the directory/files containing tests. This solves an issue + building the package without pandas in SLE. + ------------------------------------------------------------------- Wed Dec 13 16:18:51 UTC 2023 - Ben Greiner diff --git a/python-jsonpickle.spec b/python-jsonpickle.spec index 322277e..c44e49c 100644 --- a/python-jsonpickle.spec +++ b/python-jsonpickle.spec @@ -1,7 +1,7 @@ # # spec file for package python-jsonpickle # -# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -24,6 +24,7 @@ Summary: Python library for serializing any arbitrary object graph into J License: BSD-3-Clause URL: https://github.com/jsonpickle/jsonpickle Source: https://files.pythonhosted.org/packages/source/j/jsonpickle/jsonpickle-%{version}.tar.gz +Patch1: enable_gmpy_test.patch BuildRequires: %{python_module base >= 3.7} BuildRequires: %{python_module importlib_metadata if %python-base < 3.8} BuildRequires: %{python_module pip} @@ -41,10 +42,14 @@ BuildRequires: %{python_module SQLAlchemy} BuildRequires: %{python_module ecdsa} BuildRequires: %{python_module gmpy2} BuildRequires: %{python_module numpy} +%if 0%{?suse_version} >= 1550 BuildRequires: %{python_module pandas} BuildRequires: %{python_module pymongo} -BuildRequires: %{python_module pytest} BuildRequires: %{python_module scikit-learn} +%else +BuildRequires: %{python_module bson} +%endif +BuildRequires: %{python_module pytest} BuildRequires: %{python_module simplejson} BuildRequires: %{python_module ujson} # /SECTION @@ -71,7 +76,11 @@ sed -i 's/ --cov//' pytest.ini donttest="test_multindex_dataframe_roundtrip" # https://github.com/jsonpickle/jsonpickle/issues/460 donttest+=" or test_timedelta_index_roundtrip" +%if 0%{?suse_version} < 1550 +%pytest -ra -k "not ($donttest)" tests jsonpickle/pickler.py jsonpickle/unpickler.py jsonpickle/util.py +%else %pytest -ra -k "not ($donttest)" +%endif %files %{python_files} %license LICENSE