Skip to content

MAINT Remove setuptools dependency from tests #29261

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions build_tools/azure/cpython_free_threaded_lock.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This file is autogenerated by pip-compile with Python 3.13
# by the following command:
#
# 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
# pip-compile --output-file=/scikit-learn/build_tools/azure/cpython_free_threaded_lock.txt /scikit-learn/build_tools/azure/cpython_free_threaded_requirements.txt
#
execnet==2.1.1
# via pytest-xdist
Expand Down Expand Up @@ -33,7 +33,3 @@ pytest-xdist==3.6.1
# via -r /scikit-learn/build_tools/azure/cpython_free_threaded_requirements.txt
threadpoolctl==3.5.0
# via -r /scikit-learn/build_tools/azure/cpython_free_threaded_requirements.txt

# The following packages are considered to be unsafe in a requirements file:
setuptools==70.0.0
# via -r /scikit-learn/build_tools/azure/cpython_free_threaded_requirements.txt
5 changes: 1 addition & 4 deletions build_tools/azure/cpython_free_threaded_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# To generate cpython_free_threaded_lock.txt, use the following command:
# 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'
# 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'

# The reason behind it is that you need python-3.13t to generate the pip lock
# file. For pure Python wheel this does not really matter. But when there are
Expand All @@ -12,6 +12,3 @@ pytest
pytest-xdist
ninja
meson-python
# For some reason some of our tests require setuptools.
# TODO: update those tests to remove the dependency.
setuptools
4 changes: 2 additions & 2 deletions sklearn/_build_utils/pre_build_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
import tempfile
import textwrap

from setuptools.command.build_ext import customize_compiler, new_compiler


def compile_test_program(code, extra_preargs=None, extra_postargs=None):
"""Check that some C code can be compiled and run"""
from setuptools.command.build_ext import customize_compiler, new_compiler

ccompiler = new_compiler()
customize_compiler(ccompiler)

Expand Down
1 change: 1 addition & 0 deletions sklearn/tests/test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ def test_check_estimator_generate_only():


def test_setup_py_check():
pytest.importorskip("setuptools")
# Smoke test `python setup.py check` command run at the root of the
# scikit-learn source tree.
cwd = os.getcwd()
Expand Down
Loading