forked from neurodata/scikit-learn
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'neurodata:submodulev3' into submodulev3
- Loading branch information
Showing
898 changed files
with
24,921 additions
and
15,524 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,3 @@ omit = | |
*/sklearn/externals/* | ||
*/sklearn/_build_utils/* | ||
*/benchmarks/* | ||
**/setup.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
name: CUDA GPU | ||
|
||
# Only run this workflow when a Pull Request is labeled with the | ||
# 'CUDA CI' label. | ||
on: | ||
pull_request: | ||
types: | ||
- labeled | ||
|
||
jobs: | ||
build_wheel: | ||
if: contains(github.event.pull_request.labels.*.name, 'CUDA CI') | ||
runs-on: "ubuntu-latest" | ||
name: Build wheel for Pull Request | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Build wheels | ||
uses: pypa/[email protected] | ||
env: | ||
CIBW_BUILD: cp312-manylinux_x86_64 | ||
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 | ||
CIBW_BUILD_VERBOSITY: 1 | ||
CIBW_ARCHS: x86_64 | ||
|
||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: cibw-wheels | ||
path: ./wheelhouse/*.whl | ||
|
||
tests: | ||
if: contains(github.event.pull_request.labels.*.name, 'CUDA CI') | ||
needs: [build_wheel] | ||
runs-on: | ||
group: cuda-gpu-runner-group | ||
# Set this high enough so that the tests can comforatble run. We set a | ||
# timeout to make abusing this workflow less attractive. | ||
timeout-minutes: 20 | ||
name: Run Array API unit tests | ||
steps: | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
pattern: cibw-wheels | ||
path: ~/dist | ||
|
||
- uses: actions/setup-python@v5 | ||
with: | ||
# XXX: The 3.12.4 release of Python on GitHub Actions is corrupted: | ||
# https://github.com/actions/setup-python/issues/886 | ||
python-version: '3.12.3' | ||
- name: Checkout main repository | ||
uses: actions/checkout@v4 | ||
- name: Cache conda environment | ||
id: cache-conda | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/conda | ||
key: ${{ runner.os }}-build-${{ hashFiles('build_tools/github/create_gpu_environment.sh') }}-${{ hashFiles('build_tools/github/pylatest_conda_forge_cuda_array-api_linux-64_conda.lock') }} | ||
- name: Install miniforge | ||
if: ${{ steps.cache-conda.outputs.cache-hit != 'true' }} | ||
run: bash build_tools/github/create_gpu_environment.sh | ||
- name: Install scikit-learn | ||
run: | | ||
source "${HOME}/conda/etc/profile.d/conda.sh" | ||
conda activate sklearn | ||
pip install ~/dist/cibw-wheels/$(ls ~/dist/cibw-wheels) | ||
- name: Run array API tests | ||
run: | | ||
source "${HOME}/conda/etc/profile.d/conda.sh" | ||
conda activate sklearn | ||
python -c "import sklearn; sklearn.show_versions()" | ||
SCIPY_ARRAY_API=1 pytest --pyargs sklearn -k 'array_api' | ||
# Run in /home/runner to not load sklearn from the checkout repo | ||
working-directory: /home/runner |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Remove "CUDA CI" Label | ||
|
||
# This workflow removes the "CUDA CI" label that triggers the actual | ||
# CUDA CI. It is separate so that we can use the `pull_request_target` | ||
# trigger which has a API token with write access. | ||
on: | ||
pull_request_target: | ||
types: | ||
- labeled | ||
|
||
# In order to remove the "CUDA CI" label we need to have write permissions for PRs | ||
permissions: | ||
pull-requests: write | ||
|
||
jobs: | ||
label-remover: | ||
if: contains(github.event.pull_request.labels.*.name, 'CUDA CI') | ||
name: Remove "CUDA CI" Label | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions-ecosystem/action-remove-labels@v1 | ||
with: | ||
labels: CUDA CI |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
# Workflow to update lock files in a PR, triggered by specific PR comments | ||
name: Update lock files in PR | ||
on: | ||
issue_comment: | ||
types: [created] | ||
|
||
permissions: | ||
contents: write | ||
statuses: write | ||
|
||
jobs: | ||
update-lock-files: | ||
if: >- | ||
github.repository == 'scikit-learn/scikit-learn' | ||
&& github.event.issue.pull_request | ||
&& startsWith(github.event.comment.body, '@scikit-learn-bot update lock-files') | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# There is no direct way to get the HEAD information directly from issue_comment | ||
# event, so we use the GitHub CLI to get the PR head ref and repository | ||
- name: Get pull request HEAD information | ||
id: pr-head-info | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
pr_info=$(gh pr view ${{ github.event.issue.number }} --repo ${{ github.repository }} --json headRefName,headRefOid,headRepository,headRepositoryOwner) | ||
pr_head_ref=$(echo "$pr_info" | jq -r '.headRefName') | ||
pr_head_sha=$(echo "$pr_info" | jq -r '.headRefOid') | ||
pr_head_repository=$(echo "$pr_info" | jq -r '.headRepositoryOwner.login + "/" + .headRepository.name') | ||
echo "pr_head_ref=$pr_head_ref" >> $GITHUB_OUTPUT | ||
echo "pr_head_sha=$pr_head_sha" >> $GITHUB_OUTPUT | ||
echo "pr_head_repository=$pr_head_repository" >> $GITHUB_OUTPUT | ||
# Set the status of the latest commit in the PR to indicate that the update is in progress | ||
# https://docs.github.com/en/rest/commits/statuses?apiVersion=2022-11-28#create-a-commit-status | ||
- name: Set pending status | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
gh api \ | ||
--method POST \ | ||
-H "Accept: application/vnd.github+json" \ | ||
-H "X-GitHub-Api-Version: 2022-11-28" \ | ||
/repos/${{ github.repository }}/statuses/${{ steps.pr-head-info.outputs.pr_head_sha }} \ | ||
-f "state=pending" \ | ||
-f "target_url=https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" \ | ||
-f "description=Updating lock files..." \ | ||
-f "context=update-lock-files-pr" | ||
- name: Check out the PR branch | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ steps.pr-head-info.outputs.pr_head_ref }} | ||
repository: ${{ steps.pr-head-info.outputs.pr_head_repository }} | ||
|
||
# We overwrite all the scripts we are going to use in this workflow with their | ||
# versions on main; since this workflow has the write permissions this is to avoid | ||
# malicious changes to these scripts in PRs to be executed | ||
- name: Download scripts from main | ||
run: | | ||
curl https://raw.githubusercontent.com/${{ github.repository }}/main/build_tools/shared.sh --retry 5 -o ./build_tools/shared.sh | ||
curl https://raw.githubusercontent.com/${{ github.repository }}/main/build_tools/update_environments_and_lock_files.py --retry 5 -o ./build_tools/update_environments_and_lock_files.py | ||
curl https://raw.githubusercontent.com/${{ github.repository }}/main/build_tools/on_pr_comment_update_environments_and_lock_files.py --retry 5 -o ./build_tools/on_pr_comment_update_environments_and_lock_files.py | ||
- name: Update lock files | ||
env: | ||
COMMENT: ${{ github.event.comment.body }} | ||
# We download the lock files update scripts from main, since this workflow is | ||
# run from main itself | ||
run: | | ||
source build_tools/shared.sh | ||
source $CONDA/bin/activate | ||
conda install -n base conda conda-libmamba-solver -y | ||
conda config --set solver libmamba | ||
conda install -c conda-forge "$(get_dep conda-lock min)" -y | ||
python build_tools/on_pr_comment_update_environments_and_lock_files.py | ||
- name: Set completion status | ||
if: ${{ always() }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
gh api \ | ||
--method POST \ | ||
-H "Accept: application/vnd.github+json" \ | ||
-H "X-GitHub-Api-Version: 2022-11-28" \ | ||
/repos/${{ github.repository }}/statuses/${{ steps.pr-head-info.outputs.pr_head_sha }} \ | ||
-f "state=${{ job.status == 'success' && 'success' || 'error' }}" \ | ||
-f "target_url=https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" \ | ||
-f "description=Lock files ${{ job.status == 'success' && 'updated' || 'failed to update' }}." \ | ||
-f "context=update-lock-files-pr" |
Oops, something went wrong.