Skip to content

Commit 4cf0772

Browse files
authored
MAINT Remove setuptools dependency from tests (scikit-learn#29261)
1 parent 5080f25 commit 4cf0772

File tree

4 files changed

+5
-11
lines changed

4 files changed

+5
-11
lines changed

build_tools/azure/cpython_free_threaded_lock.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# This file is autogenerated by pip-compile with Python 3.13
33
# by the following command:
44
#
5-
# pip-compile --allow-unsafe --output-file=/scikit-learn/build_tools/azure/cpython_free_threaded_lock.txt /scikit-learn/build_tools/azure/cpython_free_threaded_requirements.txt
5+
# pip-compile --output-file=/scikit-learn/build_tools/azure/cpython_free_threaded_lock.txt /scikit-learn/build_tools/azure/cpython_free_threaded_requirements.txt
66
#
77
execnet==2.1.1
88
# via pytest-xdist
@@ -33,7 +33,3 @@ pytest-xdist==3.6.1
3333
# via -r /scikit-learn/build_tools/azure/cpython_free_threaded_requirements.txt
3434
threadpoolctl==3.5.0
3535
# via -r /scikit-learn/build_tools/azure/cpython_free_threaded_requirements.txt
36-
37-
# The following packages are considered to be unsafe in a requirements file:
38-
setuptools==70.0.0
39-
# via -r /scikit-learn/build_tools/azure/cpython_free_threaded_requirements.txt

build_tools/azure/cpython_free_threaded_requirements.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# To generate cpython_free_threaded_lock.txt, use the following command:
2-
# docker run -v $PWD:/scikit-learn -it ubuntu bash -c 'export DEBIAN_FRONTEND=noninteractive; apt-get -yq update; apt-get install software-properties-common ccache -y; add-apt-repository --yes ppa:deadsnakes/nightly; apt-get update -y; apt-get install -y --no-install-recommends python3.13-dev python3.13-venv python3.13-nogil; python3.13t -m venv /venvs/myenv; source /venvs/myenv/bin/activate; pip install pip-tools; pip-compile --allow-unsafe /scikit-learn/build_tools/azure/cpython_free_threaded_requirements.txt -o /scikit-learn/build_tools/azure/cpython_free_threaded_lock.txt'
2+
# docker run -v $PWD:/scikit-learn -it ubuntu bash -c 'export DEBIAN_FRONTEND=noninteractive; apt-get -yq update; apt-get install software-properties-common ccache -y; add-apt-repository --yes ppa:deadsnakes/nightly; apt-get update -y; apt-get install -y --no-install-recommends python3.13-dev python3.13-venv python3.13-nogil; python3.13t -m venv /venvs/myenv; source /venvs/myenv/bin/activate; pip install pip-tools; pip-compile /scikit-learn/build_tools/azure/cpython_free_threaded_requirements.txt -o /scikit-learn/build_tools/azure/cpython_free_threaded_lock.txt'
33

44
# The reason behind it is that you need python-3.13t to generate the pip lock
55
# file. For pure Python wheel this does not really matter. But when there are
@@ -12,6 +12,3 @@ pytest
1212
pytest-xdist
1313
ninja
1414
meson-python
15-
# For some reason some of our tests require setuptools.
16-
# TODO: update those tests to remove the dependency.
17-
setuptools

sklearn/_build_utils/pre_build_helpers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
import tempfile
88
import textwrap
99

10-
from setuptools.command.build_ext import customize_compiler, new_compiler
11-
1210

1311
def compile_test_program(code, extra_preargs=None, extra_postargs=None):
1412
"""Check that some C code can be compiled and run"""
13+
from setuptools.command.build_ext import customize_compiler, new_compiler
14+
1515
ccompiler = new_compiler()
1616
customize_compiler(ccompiler)
1717

sklearn/tests/test_common.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ def test_check_estimator_generate_only():
177177

178178

179179
def test_setup_py_check():
180+
pytest.importorskip("setuptools")
180181
# Smoke test `python setup.py check` command run at the root of the
181182
# scikit-learn source tree.
182183
cwd = os.getcwd()

0 commit comments

Comments
 (0)