8000 Merging -s · scikit-learn/scikit-learn@83aed27 · GitHub
[go: up one dir, main page]

Skip to content

Commit 83aed27

Browse files
committed
Merging -s
2 parents fcebee9 + 8f167d2 commit 83aed27

File tree

690 files changed

+26423
-13431
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

690 files changed

+26423
-13431
lines changed

.binder/postBuild

100644100755
+4-4
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ set -e
66
# inside a git checkout of the scikit-learn/scikit-learn repo. This script is
77
# generating notebooks from the scikit-learn python examples.
88

9-
if [[ ! -f /.dockerenv ]]; then
10-
echo "This script was written for repo2docker and is supposed to run inside a docker container."
11-
echo "Exiting because this script can delete data if run outside of a docker container."
9+
if [[ -z "${REPO_DIR}" ]]; then
10+
echo "This script was written for repo2docker and the REPO_DIR environment variable is supposed to be set."
11+
echo "Exiting because this script can delete data if run outside of a repo2docker context."
1212
exit 1
1313
fi
1414

@@ -23,7 +23,7 @@ find . -delete
2323
GENERATED_NOTEBOOKS_DIR=.generated-notebooks
2424
cp -r $TMP_CONTENT_DIR/examples $GENERATED_NOTEBOOKS_DIR
2525

26-
find $GENERATED_NOTEBOOKS_DIR -name '*.py' -exec sphx_glr_python_to_jupyter.py '{}' +
26+
find $GENERATED_NOTEBOOKS_DIR -name '*.py' -exec sphinx_gallery_py2jupyter '{}' +
2727
NON_NOTEBOOKS=$(find $GENERATED_NOTEBOOKS_DIR -type f | grep -v '\.ipynb')
2828
rm -f $NON_NOTEBOOKS
2929

.circleci/config.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818

1919
doc-min-dependencies:
2020
docker:
21-
- image: cimg/python:3.9.18
21+
- image: cimg/base:current-22.04
2222
environment:
2323
- MKL_NUM_THREADS: 2
2424
- OPENBLAS_NUM_THREADS: 2
@@ -56,7 +56,7 @@ jobs:
5656

5757
doc:
5858
docker:
59-
- image: cimg/python:3.9.18
59+
- image: cimg/base:current-22.04
6060
environment:
6161
- MKL_NUM_THREADS: 2
6262
- OPENBLAS_NUM_THREADS: 2
@@ -98,7 +98,7 @@ jobs:
9898

9999
deploy:
100100
docker:
101-
- image: cimg/python:3.9.18
101+
- image: cimg/base:current-22.04
102102
steps:
103103
- checkout
104104
- run: ./build_tools/circle/checkout_merge_commit.sh
@@ -107,7 +107,7 @@ jobs:
107107
- attach_workspace:
108108
at: doc/_build/html
109109
- run: ls -ltrh doc/_build/html/stable
110-
- deploy:
110+
- run:
111111
command: |
112112
if [[ "${CIRCLE_BRANCH}" =~ ^main$|^[0-9]+\.[0-9]+\.X$ ]]; then
113113
bash build_tools/circle/push_doc.sh doc/_build/html/stable

.cirrus.star

-37
This file was deleted.

.coveragerc

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
[run]
2-
branch = True
2+
# Use statement coverage rather than branch coverage because
3+
# COVERAGE_CORE=sysmon can make branch coverage slower rather than faster. See
4+
# https://github.com/nedbat/coveragepy/issues/1812 for more details.
5+
branch = False
36
source = sklearn
47
parallel = True
58
omit =

.github/ISSUE_TEMPLATE/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
blank_issues_enabled: true
1+
blank_issues_enabled: false
22
contact_links:
33
- name: Discussions
44
url: https://github.com/scikit-learn/scikit-learn/discussions/new

.github/workflows/arm-unit-tests.yml

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Unit test for ARM
2+
permissions:
3+
contents: read
4+
5+
on:
6+
push:
7+
pull_request:
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
lint:
15+
name: Lint
16+
runs-on: ubuntu-latest
17+
if: github.repository == 'scikit-learn/scikit-learn'
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
- uses: actions/setup-python@v5
23+
with:
24+
python-version: '3.12'
25+
cache: 'pip'
26+
- name: Install linters
27+
run: |
28+
source build_tools/shared.sh
29+
# Include pytest compatibility with mypy
30+
pip install pytest $(get_dep ruff min) $(get_dep mypy min) $(get_dep black min) cython-lint
31+
- name: Run linters
32+
run: ./build_tools/linting.sh
33+
- name: Run Meson OpenMP checks
34+
run: |
35+
pip install ninja meson scipy
36+
python build_tools/check-meson-openmp-dependencies.py
37+
38+
run-unit-tests:
39+
name: Run unit tests
40+
runs-on: ubuntu-24.04-arm
41+
if: github.repository == 'scikit-learn/scikit-learn'
42+
needs: [lint]
43+
steps:
44+
- name: Checkout
45+
uses: actions/checkout@v4
46+
- uses: mamba-org/setup-micromamba@v2
47+
with:
48+
environment-file: build_tools/github/pymin_conda_forge_arm_linux-aarch64_conda.lock
49+
environment-name: ci
50+
cache-environment: true
51+
52+
- name: Build and run tests
53+
shell: bash -el {0}
54+
run: bash build_tools/github/build_test_arm.sh

.github/workflows/check-changelog.yml

+15-47
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,36 @@
11
name: Check Changelog
2+
permissions:
3+
contents: read
4+
25
# This check makes sure that the changelog is properly updated
36
# when a PR introduces a change in a test file.
47
# To bypass this check, label the PR with "No Changelog Needed".
58
on:
69
pull_request:
7-
types: [opened, edited, labeled, unlabeled, synchronize]
10+
types: [opened, synchronize, labeled, unlabeled]
811

912
jobs:
1013
check:
1114
name: A reviewer will let you know if it is required or can be bypassed
1215
runs-on: ubuntu-latest
13-
if: ${{ contains(github.event.pull_request.labels.*.name, 'No Changelog Needed') == 0 }}
1416
steps:
15-
- name: Get PR number and milestone
16-
run: |
17-
echo "PR_NUMBER=${{ github.event.pull_request.number }}" >> $GITHUB_ENV
18-
echo "TAGGED_MILESTONE=${{ github.event.pull_request.milestone.title }}" >> $GITHUB_ENV
1917
- uses: actions/checkout@v4
2018
with:
2119
fetch-depth: '0'
22-
- name: Check the changelog entry
20+
- name: Check if tests have changed
21+
id: tests_changed
2322
run: |
2423
set -xe
2524
changed_files=$(git diff --name-only origin/main)
2625
# Changelog should be updated only if tests have been modified
27-
if [[ ! "$changed_files" =~ tests ]]
26+
if [[ "$changed_files" =~ tests ]]
2827
then
29-
exit 0
30-
fi
31-
all_changelogs=$(cat ./doc/whats_new/v*.rst)
32-
if [[ "$all_changelogs" =~ :pr:\`$PR_NUMBER\` ]]
33-
then
34-
echo "Changelog has been updated."
35-
# If the pull request is milestoned check the correspondent changelog
36-
if exist -f ./doc/whats_new/v${TAGGED_MILESTONE:0:4}.rst
37-
then
38-
expected_changelog=$(cat ./doc/whats_new/v${TAGGED_MILESTONE:0:4}.rst)
39-
if [[ "$expected_changelog" =~ :pr:\`$PR_NUMBER\` ]]
40-
then
41-
echo "Changelog and milestone correspond."
42-
else
43-
echo "Changelog and milestone do not correspond."
44-
echo "If you see this error make sure that the tagged milestone for the PR"
45-
echo "and the edited changelog filename properly match."
46-
exit 1
47-
fi
48-
fi
49-
else
50-
echo "A Changelog entry is missing."
51-
echo ""
52-
echo "Please add an entry to the changelog at 'doc/whats_new/v*.rst'"
53-
echo "to document your change assuming that the PR will be merged"
54-
echo "in time for the next release of scikit-learn."
55-
echo ""
56-
echo "Look at other entries in that file for inspiration and please"
57-
echo "reference this pull request using the ':pr:' directive and"
58-
echo "credit yourself (and other contributors if applicable) with"
59-
echo "the ':user:' directive."
60-
echo ""
61-
echo "If you see this error and there is already a changelog entry,"
62-
echo "check that the PR number is correct."
63-
echo ""
64-
echo "If you believe that this PR does not warrant a changelog"
65-
echo "entry, say so in a comment so that a maintainer will label"
66-
echo "the PR with 'No Changelog Needed' to bypass this check."
67-
exit 1
28+
echo "check_changelog=true" >> $GITHUB_OUTPUT
6829
fi
30+
31+
- name: Check changelog entry
32+
if: steps.tests_changed.outputs.check_changelog == 'true'
33+
uses: scientific-python/action-towncrier-changelog@v1
34+
env:
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
BOT_USERNAME: changelog-bot

.github/workflows/check-sdist.yml

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
name: "Check sdist"
2+
permissions:
3+
contents: read
24

35
on:
46
schedule:

.github/workflows/codeql.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
strategy:
3030
fail-fast: false
3131
matrix:
32-
language: [ 'javascript-typescript', 'python' ]
32+
language: [ 'javascript-typescript', 'python', 'actions' ]
3333
# CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ]
3434
# Use only 'java-kotlin' to analyze code written in Java, Kotlin or both
3535
# Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both

.github/workflows/cuda-ci.yml

+32-2
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,41 @@ on:
88
- labeled
99

1010
jobs:
11+
build_wheel:
12+
if: contains(github.event.pull_request.labels.*.name, 'CUDA CI')
13+
runs-on: "ubuntu-latest"
14+
name: Build wheel for Pull Request
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Build wheels
19+
uses: pypa/cibuildwheel@v2.23.0
20+
env:
21+
CIBW_BUILD: cp313-manylinux_x86_64
22+
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
23+
CIBW_BUILD_VERBOSITY: 1
24+
CIBW_ARCHS: x86_64
25+
26+
- uses: actions/upload-artifact@v4
27+
with:
28+
name: cibw-wheels
29+
path: ./wheelhouse/*.whl
30+
1131
tests:
1232
if: contains(github.event.pull_request.labels.*.name, 'CUDA CI')
33+
needs: [build_wheel]
1334
runs-on:
1435
group: cuda-gpu-runner-group
1536
# Set this high enough so that the tests can comforatble run. We set a
1637
# timeout to make abusing this workflow less attractive.
1738
timeout-minutes: 20
1839
name: Run Array API unit tests
1940
steps:
41+
- uses: actions/download-artifact@v4
42+
with:
43+
pattern: cibw-wheels
44+
path: ~/dist
45+
2046
- uses: actions/setup-python@v5
2147
with:
2248
# XXX: The 3.12.4 release of Python on GitHub Actions is corrupted:
@@ -37,10 +63,14 @@ jobs:
3763
run: |
3864
source "${HOME}/conda/etc/profile.d/conda.sh"
3965
conda activate sklearn
40-
pip install --verbose --no-build-isolation --config-settings editable-verbose=true --editable .
66+
pip install ~/dist/cibw-wheels/$(ls ~/dist/cibw-wheels)
67+
4168
- name: Run array API tests
4269
run: |
4370
source "${HOME}/conda/etc/profile.d/conda.sh"
4471
conda activate sklearn
4572
python -c "import sklearn; sklearn.show_versions()"
46-
SCIPY_ARRAY_API=1 pytest -k 'array_api'
73+
74+
SCIPY_ARRAY_API=1 pytest --pyargs sklearn -k 'array_api' -v
75+
# Run in /home/runner to not load sklearn from the checkout repo
76+
working-directory: /home/runner

.github/workflows/cuda-label-remover.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
label-remover:
1717
if: contains(github.event.pull_request.labels.*.name, 'CUDA CI')
1818
name: Remove "CUDA CI" Label
19-
runs-on: ubuntu-20.04
19+
runs-on: ubuntu-24.04
2020
steps:
2121
- uses: actions-ecosystem/action-remove-labels@v1
2222
with:

.github/workflows/label-blank-issue.yml

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
name: Labels Blank issues
2+
permissions:
3+
issues: write
24

35
on:
46
issues:

.github/workflows/labeler-title-regex.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ permissions:
1313
jobs:
1414

1515
labeler:
16-
runs-on: ubuntu-20.04
16+
runs-on: ubuntu-24.04
1717
steps:
1818
- uses: actions/checkout@v4
1919
- uses: actions/setup-python@v5

.github/workflows/lint.yml

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ jobs:
3131

3232
- name: Install dependencies
3333
run: |
34+
curl https://raw.githubusercontent.com/${{ github.repository }}/main/build_tools/shared.sh --retry 5 -o ./build_tools/shared.sh
3435
source build_tools/shared.sh
3536
# Include pytest compatibility with mypy
3637
pip install pytest $(get_dep ruff min) $(get_dep mypy min) $(get_dep black min) cython-lint

.github/workflows/publish_pypi.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ jobs:
3939
run: |
4040
python build_tools/github/check_wheels.py
4141
- name: Publish package to TestPyPI
42-
uses: pypa/gh-action-pypi-publish@ec4db0b4ddc65acdf4bff5fa45ac92d78b56bdf0 # v1.9.0
42+
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4
4343
with:
4444
repository-url: https://test.pypi.org/legacy/
4545
print-hash: true
4646
if: ${{ github.event.inputs.pypi_repo == 'testpypi' }}
4747
- name: Publish package to PyPI
48-
uses: pypa/gh-action-pypi-publish@ec4db0b4ddc65acdf4bff5fa45ac92d78b56bdf0 # v1.9.0
48+
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4
4949
if: ${{ github.event.inputs.pypi_repo == 'pypi' }}
5050
with:
5151
print-hash: true

0 commit comments

Comments
 (0)
0