Update to 1.3.1 for fix python3.11 build error

This commit is contained in:
wk333 2023-07-23 15:25:49 +08:00
parent c26f631688
commit b23c7adf7f
4 changed files with 11 additions and 76 deletions

Binary file not shown.

BIN
joblib-1.3.1.tar.gz Normal file

Binary file not shown.

View File

@ -1,71 +0,0 @@
From a9a33285fd713132786d4521be8b881d7c7b07c7 Mon Sep 17 00:00:00 2001
From: wang--ge <wang__ge@126.com>
Date: Mon, 6 Feb 2023 17:11:39 +0800
Subject: [PATCH] maint more informative assertion errors when warings happen
---
continuous_integration/run_tests.sh | 2 +-
joblib/test/test_parallel.py | 16 +++++++++++-----
2 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/continuous_integration/run_tests.sh b/continuous_integration/run_tests.sh
index 51bed5f..6e7a537 100755
--- a/continuous_integration/run_tests.sh
+++ b/continuous_integration/run_tests.sh
@@ -20,7 +20,7 @@ if [[ "$SKIP_TESTS" != "true" ]]; then
export PYTEST_ADDOPTS="--cov=joblib --cov-append"
fi
- pytest joblib -vl --timeout=60 --junitxml="${JUNITXML}"
+ pytest joblib -vl --timeout=120 --junitxml="${JUNITXML}"
make test-doc
fi
diff --git a/joblib/test/test_parallel.py b/joblib/test/test_parallel.py
index 7edeb85..9c6b2dc 100644
--- a/joblib/test/test_parallel.py
+++ b/joblib/test/test_parallel.py
@@ -17,6 +17,7 @@ from time import sleep
from pickle import PicklingError
from multiprocessing import TimeoutError
import pickle
+import warnings
import pytest
from importlib import reload
@@ -190,22 +191,27 @@ def test_main_thread_renamed_no_warning(backend, monkeypatch):
def _assert_warning_nested(backend, inner_n_jobs, expected):
- with warns(None) as records:
+ with warnings.catch_warnings(record=True) as records:
+ warnings.simplefilter("always")
parallel_func(backend=backend, inner_n_jobs=inner_n_jobs)
+ messages = [w.message for w in records]
if expected:
# with threading, we might see more that one records
- if len(records) > 0:
- return 'backed parallel loops cannot' in records[0].message.args[0]
+ if warnings:
+ return (len(messages)==1 and 'backed parallel loops cannot' in messages[0].args[0])
return False
else:
- assert len(records) == 0
+ assert not messages
return True
@with_multiprocessing
@parametrize('parent_backend,child_backend,expected', [
- ('loky', 'multiprocessing', True), ('loky', 'loky', False),
+ ('loky', 'multiprocessing', True),
+ # XXX: loky nested under loky causes pytest 7+ to freeze after tests end when using warnings.catch_warnings:
+ # deadlock happens in loky/process_executor.py", line 193, in _python_exit
+ # ('loky', 'loky', False),
('multiprocessing', 'multiprocessing', True),
('multiprocessing', 'loky', True),
('threading', 'multiprocessing', True),
--
2.27.0

View File

@ -1,18 +1,20 @@
%global pypi_name joblib
Name: python-%{pypi_name}
Version: 1.1.1
Version: 1.3.1
Release: 1
Summary: Utilities to provide lightweight pipelining in Python
License: BSD-3-clause
URL: https://joblib.readthedocs.io/en/latest/
Source0: https://github.com/joblib/joblib/archive/%{version}/%{pypi_name}-%{version}.tar.gz
Patch1: maint-more-informative-assertion-errors-when-warnings-happen.patch
BuildArch: noarch
BuildRequires: python3-devel
BuildRequires: python3-pip
BuildRequires: python3-wheel
#test requires
BuildRequires: python3-pytest
BuildRequires: python3-threadpoolctl
BuildRequires: procps-ng
%global _description \
Joblib is a set of tools to provide lightweight pipelining in Python.
@ -29,10 +31,10 @@ Summary: %{summary}
%autosetup -n %{pypi_name}-%{version} -p1
%build
%py3_build
%pyproject_build
%install
%py3_install
%pyproject_install
%check
@ -41,10 +43,14 @@ Summary: %{summary}
%files -n python3-%{pypi_name}
%license LICENSE.txt
%doc README.rst CHANGES.rst
%{python3_sitelib}/%{pypi_name}-*.egg-info/
%{python3_sitelib}/%{pypi_name}-*.dist-info/
%{python3_sitelib}/%{pypi_name}/
%changelog
* Sun Jul 23 2023 wangkai <13474090681@163.com> - 1.3.1-1
- Update to 1.3.1 for fix python3.11 build error
- Use pyproject to compile package
* Fri Apr 7 2023 caodongxia <caodongxia@h-partners.com> - 1.1.1-1
- Upgrade to 1.1.1