Skip to content

Commit 829f147

Browse files
committed
Add patch for scikit-learn 1.2.2
1 parent 1722a38 commit 829f147

File tree

2 files changed

+50
-2
lines changed

2 files changed

+50
-2
lines changed
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
[[rules]]
2-
# pin to 1.1.3
3-
install-priority = 10
2+
version = '== 1.2.2'
3+
patch = 'scikit-learn-1.2.2.patch'
4+
dist-type = 'sdist'
5+
6+
[[rules]]
47
version = '== 1.1.3'
58
patch = 'scikit-learn-1.1.3.patch'
9+
dist-type = 'sdist'
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
diff --git a/pyproject.toml b/pyproject.toml
2+
index f7f067e..2025d66 100644
3+
--- a/pyproject.toml
4+
+++ b/pyproject.toml
5+
@@ -3,7 +3,7 @@
6+
requires = [
7+
"setuptools",
8+
"wheel",
9+
- "Cython>=0.29.24",
10+
+ "Cython>=0.29.24,<3",
11+
12+
# use oldest-supported-numpy which provides the oldest numpy version with
13+
# wheels on PyPI
14+
diff --git a/sklearn/_build_utils/__init__.py b/sklearn/_build_utils/__init__.py
15+
index 755171e..1c14884 100644
16+
--- a/sklearn/_build_utils/__init__.py
17+
+++ b/sklearn/_build_utils/__init__.py
18+
@@ -61,10 +61,10 @@ def cythonize_extensions(extension):
19+
sklearn._OPENMP_SUPPORTED = check_openmp_support()
20+
21+
n_jobs = 1
22+
- with contextlib.suppress(ImportError):
23+
- import joblib
24+
+ # with contextlib.suppress(ImportError):
25+
+ # import joblib
26+
27+
- n_jobs = joblib.cpu_count()
28+
+ # n_jobs = joblib.cpu_count()
29+
30+
# Additional checks for Cython
31+
cython_enable_debug_directives = (
32+
diff --git a/sklearn/datasets/_svmlight_format_fast.pyx b/sklearn/datasets/_svmlight_format_fast.pyx
33+
index b578584..fc66532 100644
34+
--- a/sklearn/datasets/_svmlight_format_fast.pyx
35+
+++ b/sklearn/datasets/_svmlight_format_fast.pyx
36+
@@ -80,7 +80,7 @@ def _load_svmlight_file(f, dtype, bint multilabel, bint zero_based,
37+
if n_features and features[0].startswith(qid_prefix):
38+
_, value = features[0].split(COLON, 1)
39+
if query_id:
40+
- query.resize(len(query) + 1)
41+
+ query.resize(len(query) + 1, refcheck=False)
42+
query[len(query) - 1] = np.int64(value)
43+
features.pop(0)
44+
n_features -= 1

0 commit comments

Comments
 (0)