diff --git a/0001-joblib-unbundle-cloudpickle.patch b/0001-joblib-unbundle-cloudpickle.patch new file mode 100644 index 0000000000000000000000000000000000000000..c107f72b88eaf32db19f2e9f5e8095144310d2ca --- /dev/null +++ b/0001-joblib-unbundle-cloudpickle.patch @@ -0,0 +1,60 @@ +diff -ur joblib-1.2.0/joblib/externals/loky/backend/reduction.py joblib-1.2.0.cp/joblib/externals/loky/backend/reduction.py +--- joblib-1.2.0/joblib/externals/loky/backend/reduction.py 2022-09-15 18:00:38.000000000 +0200 ++++ joblib-1.2.0.cp/joblib/externals/loky/backend/reduction.py 2022-09-29 18:46:19.093130992 +0200 +@@ -79,7 +79,7 @@ + + # global variable to change the pickler behavior + try: +- from joblib.externals import cloudpickle # noqa: F401 ++ import cloudpickle # noqa: F401 + DEFAULT_ENV = "cloudpickle" + except ImportError: + # If cloudpickle is not present, fallback to pickle +@@ -106,7 +106,7 @@ + return + + if loky_pickler == "cloudpickle": +- from joblib.externals.cloudpickle import CloudPickler as loky_pickler_cls ++ from cloudpickle import CloudPickler as loky_pickler_cls + else: + try: + from importlib import import_module +diff -ur joblib-1.2.0/joblib/externals/loky/cloudpickle_wrapper.py joblib-1.2.0.cp/joblib/externals/loky/cloudpickle_wrapper.py +--- joblib-1.2.0/joblib/externals/loky/cloudpickle_wrapper.py 2022-09-15 18:00:38.000000000 +0200 ++++ joblib-1.2.0.cp/joblib/externals/loky/cloudpickle_wrapper.py 2022-09-29 18:46:51.641656605 +0200 +@@ -1,6 +1,6 @@ + import inspect + from functools import partial +-from joblib.externals.cloudpickle import dumps, loads ++from cloudpickle import dumps, loads + + + WRAP_CACHE = {} +diff -ur joblib-1.2.0/joblib/parallel.py joblib-1.2.0.cp/joblib/parallel.py +--- joblib-1.2.0/joblib/parallel.py 2022-09-14 21:47:04.000000000 +0200 ++++ joblib-1.2.0.cp/joblib/parallel.py 2022-09-29 18:47:16.566059100 +0200 +@@ -26,7 +26,7 @@ + from ._parallel_backends import (FallbackToBackend, MultiprocessingBackend, + ThreadingBackend, SequentialBackend, + LokyBackend) +-from .externals.cloudpickle import dumps, loads ++from cloudpickle import dumps, loads + from ._utils import eval_expr + + # Make sure that those two classes are part of the public joblib.parallel API +diff -ur joblib-1.2.0/setup.py joblib-1.2.0.cp/setup.py +--- joblib-1.2.0/setup.py 2022-09-08 09:21:15.000000000 +0200 ++++ joblib-1.2.0.cp/setup.py 2022-09-29 18:49:21.159078660 +0200 +@@ -54,8 +54,11 @@ + }, + packages=[ + 'joblib', 'joblib.test', 'joblib.test.data', +- 'joblib.externals', 'joblib.externals.cloudpickle', ++ 'joblib.externals', + 'joblib.externals.loky', 'joblib.externals.loky.backend', + ], + python_requires='>=3.7', ++ install_requires=[ ++ 'cloudpickle>=1.6', ++ ], + ) diff --git a/joblib-1.2.0.tar.gz b/joblib-1.2.0.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..e55d1855422682091e70be9c8667a704a5168e94 Binary files /dev/null and b/joblib-1.2.0.tar.gz differ diff --git a/python-joblib.spec b/python-joblib.spec new file mode 100644 index 0000000000000000000000000000000000000000..179afdb42bd28cd9d126f03bcaa1f5da89292717 --- /dev/null +++ b/python-joblib.spec @@ -0,0 +1,92 @@ +%define anolis_release 1 + +%bcond_with check +%global srcname joblib + +Name: python-%{srcname} +Version: 1.2.0 +Release: %{anolis_release}%{dist} + +Summary: Lightweight pipelining: using Python functions as pipeline jobs + +License: BSD +URL: https://joblib.readthedocs.io +Source0: %{pypi_source} + +Patch: 0001-joblib-unbundle-cloudpickle.patch + +BuildArch: noarch +BuildRequires: python3-devel +# setup.py imports joblib and that needs cloudpickle +BuildRequires: %{py3_dist cloudpickle} + +%global _description %{expand: +Joblib is a set of tools to provide lightweight pipelining in Python. +In particular, joblib offers: + * transparent disk-caching of the output values and lazy + re-evaluation (memorize pattern) + * easy simple parallel computing + * logging and tracing of the execution} + +%description %_description + +%package -n python3-%{srcname} +Summary: %{summary} + +# Testing +%if %{with check} +BuildRequires: %{py3_dist pytest} +BuildRequires: %{py3_dist numpy} +BuildRequires: %{py3_dist lz4} +BuildRequires: %{py3_dist psutil} +BuildRequires: %{py3_dist threadpoolctl} +%endif + +Recommends: %{py3_dist numpy} +Recommends: %{py3_dist lz4} +Recommends: %{py3_dist psutil} +Provides: bundled(python3dist(loky)) = 2.9.0 + +%description -n python3-%{srcname} +%_description + +%package -n python3-%{srcname}-doc +Summary: Documentation files for %{name} +Requires: python3-%{srcname} = %{EVR} +BuildArch: noarch + +%description -n python3-%{srcname}-doc +The %{name}-doc package contains documentation files for %{name}. + +%prep +%autosetup -p1 -n %{srcname}-%{version} +rm joblib/externals/cloudpickle/ -rf + +%generate_buildrequires +%pyproject_buildrequires + +%build +%pyproject_wheel + +%install +%pyproject_install + +%pyproject_save_files joblib + +%if %{with check} +%check +%pytest \ + --deselect "joblib/test/test_memory.py::test_parallel_call_cached_function_defined_in_jupyter" \ + --deselect "joblib/test/test_numpy_pickle.py::test_compress_mmap_mode_warning" \ + joblib + +%endif + +%files -n python3-%{srcname} -f %{pyproject_files} + +%files -n python3-%{srcname}-doc +%doc README.rst + +%changelog +* Tue Mar 28 2023 yuanhui - 1.2.0-1 +- Init package from upstream