8000 [cd build] [azure parallel] more clean-up · scikit-learn/scikit-learn@3363c23 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3363c23

Browse files
committed
[cd build] [azure parallel] more clean-up
1 parent 9b4a9e7 commit 3363c23

File tree

7 files changed

+16
-22
lines changed

7 files changed

+16
-22
lines changed

.github/workflows/wheels.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ jobs:
224224
- name: Setup Python
225225
uses: actions/setup-python@v5
226226
with:
227-
python-version: "3.9" # update once build dependencies are available
227+
python-version: "3.12"
228228

229229
- name: Build source distribution
230230
run: bash build_tools/github/build_source.sh

azure-pipelines.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
steps:
3232
- task: UsePythonVersion@0
3333
inputs:
34-
versionSpec: '3.9'
34+
versionSpec: '3.12'
3535
- bash: |
3636
source build_tools/shared.sh
3737
# Include pytest compatibility with mypy
@@ -203,7 +203,7 @@ jobs:
203203
not(contains(dependencies['git_commit']['outputs']['commit.message'], '[ci skip]'))
204204
)
205205
matrix:
206-
# Linux + Python 3.9 build with minimum supported version of dependencies
206+
# Linux build with minimum supported version of dependencies
207207
pymin_conda_forge_openblas_min_dependencies:
208208
DISTRIB: 'conda'
209209
LOCK_FILE: './build_tools/azure/pymin_conda_forge_openblas_min_dependencies_linux-64_conda.lock'

doc/install.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ purpose.
208208
Scikit-learn 1.0 supported Python 3.7-3.10.
209209
Scikit-learn 1.1, 1.2 and 1.3 support Python 3.8-3.12
210210
Scikit-learn 1.4 requires Python 3.9 or newer.
211+
Scikit-learn 1.7 requires Python 3.10 or newer.
211212

212213
.. _install_by_distribution:
213214

@@ -294,7 +295,7 @@ command:
294295

295296
.. prompt:: bash
296297

297-
sudo port install py39-scikit-learn
298+
sudo port install py312-scikit-learn
298299

299300

300301
Anaconda and Enthought Deployment Manager for all supported platforms

sklearn/datasets/_lfw.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
from ..utils import Bunch
2121
from ..utils._param_validation import Hidden, Interval, StrOptions, validate_params
22-
from ..utils.fixes import tarfile_extractall
2322
from ._base import (
2423
RemoteFileMetadata,
2524
_fetch_remote,
@@ -118,7 +117,11 @@ def _check_fetch_lfw(
118117

119118
logger.debug("Decompressing ED48 the data archive to %s", data_folder_path)
120119
with tarfile.open(archive_path, "r:gz") as fp:
121-
tarfile_extractall(fp, path=lfw_home)
120+
# Use filter="data" to prevent the most dangerous security issues.
121+
# For more details, see
122+
# https://docs.python.org/3.9/library/tarfile.html#tarfile.TarFile.extractall
123+
fp.extractall(path=lfw_home, filter="data")
124+
122125
remove(archive_path)
123126

124127
return lfw_home, data_folder_path

sklearn/datasets/_twenty_newsgroups.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
from ..feature_extraction.text import CountVectorizer
4444
from ..utils import Bunch, check_random_state
4545
from ..utils._param_validation import Interval, StrOptions, validate_params
46-
from ..utils.fixes import tarfile_extractall
4746
from . import get_data_home, load_files
4847
from ._base import (
4948
RemoteFileMetadata,
@@ -82,7 +81,10 @@ def _download_20newsgroups(target_dir, cache_path, n_retries, delay):
8281

8382
logger.debug("Decompressing %s", archive_path)
8483
with tarfile.open(archive_path, "r:gz") as fp:
85-
tarfile_extractall(fp, path=target_dir)
84+
# Use filter="data" to prevent the most dangerous security issues.
85+
# For more details, see
86+
# https://docs.python.org/3.9/library/tarfile.html#tarfile.TarFile.extractall
87+
fp.extractall(path=target_dir, filter="data")
8688

8789
with suppress(FileNotFoundError):
8890
os.remove(archive_path)

sklearn/meson.build

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ endif
2222
# Python interpreter can be tricky in cross-compilation settings. For more
2323
# details, see https://docs.scipy.org/doc/scipy/building/cross_compilation.html
2424
if not meson.is_cross_build()
25-
if not py.version().version_compare('>=3.9')
26-
error('scikit-learn requires Python>=3.9, got ' + py.version() + ' instead')
25+
if not py.version().version_compare('>=3.10')
26+
error('scikit-learn requires Python>=3.10, got ' + py.version() + ' instead')
2727
endif
2828

2929
cython_min_version = run_command(py, ['_min_dependencies.py', 'cython'], check: true).stdout().strip()

sklearn/utils/fixes.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -324,18 +324,6 @@ def _smallest_admissible_index_dtype(arrays=(), maxval=None, check_contents=Fals
324324
from scipy.sparse.csgraph import laplacian # type: ignore # noqa # pragma: no cover
325325

326326

327-
# TODO: Remove when we drop support for Python 3.9. Note the filter argument has
328-
# been back-ported in 3.9.17 but we can not assume anything about the micro
329-
# version, see
330-
# https://docs.python.org/3.9/library/tarfile.html#tarfile.TarFile.extractall
331-
# for more details
332-
def tarfile_extractall(tarfile, path):
333-
try:
334-
tarfile.extractall(path, filter="data")
335-
except TypeError:
336-
tarfile.extractall(path)
337-
338-
339327
def _in_unstable_openblas_configuration():
340328
"""Return True if in an unstable configuration for OpenBLAS"""
341329

0 commit comments

Comments
 (0)
0