10000 Merge branch 'main' of https://github.com/scikit-learn/scikit-learn i… · scikit-learn/scikit-learn@d6c7f0f · GitHub
[go: up one dir, main page]

Skip to content

Commit d6c7f0f

Browse files
author
Gaurav Chawla
committed
Merge branch 'main' of https://github.com/scikit-learn/scikit-learn into issue_14257
2 parents 4b2b050 + 80c47b0 commit d6c7f0f

File tree

132 files changed

+3821
-1148
lines changed

Some content is hidden

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

132 files changed

+3821
-1148
lines changed

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ jobs:
132132
- run: ls -ltrh doc/_build/html/stable
133133
- deploy:
134134
command: |
135-
if [[ "${CIRCLE_BRANCH}" =~ ^master$|^[0-9]+\.[0-9]+\.X$ ]]; then
135+
if [[ "${CIRCLE_BRANCH}" =~ ^main$|^[0-9]+\.[0-9]+\.X$ ]]; then
136136
bash build_tools/circle/push_doc.sh doc/_build/html/stable
137137
fi
138138
@@ -162,6 +162,6 @@ workflows:
162162
filters:
163163
branches:
164164
only:
165-
- master
165+
- main
166166
jobs:
167167
- pypy3

.codecov.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ coverage:
44
status:
55
project:
66
default:
7-
# Commits pushed to master should not make the overall
7+
# Commits pushed to main should not make the overall
88
# project coverage decrease by more than 1%:
99
target: auto
1010
threshold: 1%

.github/labeler.yml

Lines changed: 0 additions & 5 deletions
This file was deleted.

.github/scripts/label_title_regex.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
"""Labels PRs based on title. Must be run in a github action with the
2+
pull_request_target event."""
3+
from ghapi.all import context_github
4+
from ghapi.all import GhApi
5+
from ghapi.all import user_repo
6+
from ghapi.all import github_token
7+
import re
8+
9+
owner, repo = user_repo()
10+
pull_request = context_github.event.pull_request
11+
title = pull_request.title
12+
13+
regex_to_labels = [
14+
(r"\bDOC\b", "Documentation"),
15+
(r"\bCI\b", "Build / CI")
16+
]
17+
18+
labels_to_add = [
19+
label for regex, label in regex_to_labels
20+
if re.search(regex, title)
21+
]
22+
23+
if labels_to_add:
24+
api = GhApi(owner=owner, repo=repo, token=github_token())
25+
api.issues.add_labels(pull_request.number, labels=labels_to_add)
Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
name: Pull Request Regex Title Labeler
22
on:
33
pull_request_target:
4-
types: [opened]
4+
types: [opened, edited]
55

66
jobs:
77

88
labeler:
9-
runs-on: ubuntu-latest
9+
runs-on: ubuntu-20.04
1010
steps:
11-
- name: Check Labels
12-
id: labeler
13-
continue-on-error: true
14-
uses: jimschubert/labeler-action@v2
11+
- uses: actions/checkout@v2
12+
- uses: actions/setup-python@v2
1513
with:
16-
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
14+
python-version: '3.9'
15+
- name: Install ghapi
16+
run: pip install -Uq ghapi
17+
- name: Label pull request
18+
run: python .github/scripts/label_title_regex.py
19+
env:
20+
CONTEXT_GITHUB: ${{ toJson(github) }}

.github/workflows/twitter.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Tweet the URL of a commit on @sklearn_commits whenever a push event
2-
# happens on the master branch
2+
# happens on the main branch
33
name: Twitter Push Notification
44

55

66
on:
77
push:
88
branches:
9-
- master
9+
- main
1010

1111

1212
jobs:

.github/workflows/wheels.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ on:
77
- cron: "42 3 */1 * *"
88
push:
99
branches:
10-
- master
10+
- main
1111
# Release branches
1212
- "[0-9]+.[0-9]+.X"
1313
pull_request:
1414
branches:
15-
- master
15+
- main
1616
- "[0-9]+.[0-9]+.X"
1717
# Manual run
1818
workflow_dispatch:
@@ -38,7 +38,7 @@ jobs:
3838

3939
# Build the wheels for Linux, Windows and macOS for Python 3.6 and newer
4040
build_wheels:
41-
name: Build wheel for cp${{ matrix.python }}-${{ matrix.platform_id }}
41+
name: Build wheel for cp${{ matrix.python }}-${{ matrix.platform_id }}-${{ matrix.manylinux_image }}
4242
runs-on: ${{ matrix.os }}
4343
needs: check_build_trigger
4444
if: needs.check_build_trigger.outputs.build
@@ -50,6 +50,7 @@ jobs:
5050
os: [windows-latest, ubuntu-latest, macos-latest]
5151
python: [36, 37, 38, 39]
5252
bitness: [32, 64]
53+
manylinux_image: [manylinux1, manylinux2010]
5354
include:
5455
# Run 32 and 64 bit version in parallel for Linux and Windows
5556
- os: windows-latest
@@ -70,6 +71,12 @@ jobs:
7071
exclude:
7172
- os: macos-latest
7273
bitness: 32
74+
# Remove manylinux1 from the windows and osx build matrix since
75+
# manylinux_image is not used for these platforms
76+
- os: windows-latest
77+
manylinux_image: manylinux1
78+
- os: macos-latest
79+
manylinux_image: manylinux1
7380

7481
steps:
7582
- name: Checkout scikit-learn
@@ -88,6 +95,8 @@ jobs:
8895
SKLEARN_BUILD_PARALLEL=3
8996
MACOSX_DEPLOYMENT_TARGET=10.13
9097
CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.platform_id }}
98+
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.manylinux_image }}
99+
CIBW_MANYLINUX_I686_IMAGE: ${{ matrix.manylinux_image }}
91100
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: bash build_tools/github/repair_windows_wheels.sh {wheel} {dest_dir} ${{ matrix.bitness }}
92101
CIBW_BEFORE_TEST_WINDOWS: bash build_tools/github/build_minimal_windows_image.sh ${{ matrix.python }} ${{ matrix.bitness }}
93102
CIBW_TEST_REQUIRES: pytest pandas threadpoolctl

.travis.yml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,33 +22,27 @@ env:
2222
- CIBW_BUILD_VERBOSITY=1
2323
- CIBW_TEST_REQUIRES="pytest pytest-xdist threadpoolctl"
2424
- CIBW_TEST_COMMAND="bash {project}/build_tools/travis/test_wheels.sh"
25-
- CIBW_ENVIRONMENT="CPU_COUNT=8
25+
- CIBW_ENVIRONMENT="CPU_COUNT=2
2626
OMP_NUM_THREADS=2
2727
OPENBLAS_NUM_THREADS=2
28-
SKLEARN_BUILD_PARALLEL=8
28+
SKLEARN_BUILD_PARALLEL=3
2929
SKLEARN_SKIP_NETWORK_TESTS=1"
3030

3131
jobs:
3232
include:
33-
- python: 3.7
34-
env:
35-
- CHECK_WARNING=true
36-
- BUILD_WITH_ICC=true
37-
if: type = cron OR commit_message =~ /\[icc-build\]/
38-
3933
# Manual trigger of linux/arm64 tests in PR without triggering the full
40-
# wheel building process for all the Python versions.
34+
# wheel building process for all the Python versions.
4135
- python: 3.9
4236
os: linux
4337
arch: arm64
4438
if: commit_message =~ /\[arm64\]/
4539
env:
46-
- CPU_COUNT=8
40+
- CPU_COUNT=4
4741

4842
# Linux environments to build the scikit-learn wheels for the ARM64
4943
# architecture and Python 3.6 and newer. This is used both at release time
5044
# with the manual trigger in the commit message in the release branch and as
51-
# a scheduled task to build the weekly dev build on the master branch. The
45+
# a scheduled task to build the weekly dev build on the main branch. The
5246
# weekly frequency is meant to avoid depleting the Travis CI credits too
5347
# fast.
5448
- python: 3.6

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ documentation is no less important than improving the library itself. If you
1313
find a typo in the documentation, or have made improvements, do not hesitate to
1414
send an email to the mailing list or preferably submit a GitHub pull request.
1515
Documentation can be found under the
16-
[doc/](https://github.com/scikit-learn/scikit-learn/tree/master/doc) directory.
16+
[doc/](https://github.com/scikit-learn/scikit-learn/tree/main/doc) directory.
1717

1818
But there are many other ways to help. In particular answering queries on the
1919
[issue tracker](https://github.com/scikit-learn/scikit-learn/issues),

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,4 @@ code-analysis:
6565
pylint -E -i y sklearn/ -d E1103,E0611,E1101
6666

6767
flake8-diff:
68-
git diff upstream/master -u -- "*.py" | flake8 --diff
68+
git diff upstream/main -u -- "*.py" | flake8 --diff

PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!--
22
Thanks for contributing a pull request! Please ensure you have taken a look at
3-
the contribution guidelines: https://github.com/scikit-learn/scikit-learn/blob/master/CONTRIBUTING.md
3+
the contribution guidelines: https://github.com/scikit-learn/scikit-learn/blob/main/CONTRIBUTING.md
44
-->
55

66
#### Reference Issues/PRs

README.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
33
|Azure|_ |Travis|_ |Codecov|_ |CircleCI|_ |Nightly wheels|_ |PythonVersion|_ |PyPi|_ |DOI|_
44

5-
.. |Azure| image:: https://dev.azure.com/scikit-learn/scikit-learn/_apis/build/status/scikit-learn.scikit-learn?branchName=master
6-
.. _Azure: https://dev.azure.com/scikit-learn/scikit-learn/_build/latest?definitionId=1&branchName=master
5+
.. |Azure| image:: https://dev.azure.com/scikit-learn/scikit-learn/_apis/build/status/scikit-learn.scikit-learn?branchName=main
6+
.. _Azure: https://dev.azure.com/scikit-learn/scikit-learn/_build/latest?definitionId=1&branchName=main
77

8-
.. |Travis| image:: https://api.travis-ci.com/scikit-learn/scikit-learn.svg?branch=master
8+
.. |Travis| image:: https://api.travis-ci.com/scikit-learn/scikit-learn.svg?branch=main
99
.. _Travis: https://travis-ci.com/scikit-learn/scikit-learn
1010

11-
.. |Codecov| image:: https://codecov.io/github/scikit-learn/scikit-learn/badge.svg?branch=master&service=github
12-
.. _Codecov: https://codecov.io/github/scikit-learn/scikit-learn?branch=master
11+
.. |Codecov| image:: https://codecov.io/github/scikit-learn/scikit-learn/badge.svg?branch=main&service=github
12+
.. _Codecov: https://codecov.io/github/scikit-learn/scikit-learn?branch=main
1313

14-
.. |CircleCI| image:: https://circleci.com/gh/scikit-learn/scikit-learn/tree/master.svg?style=shield&circle-token=:circle-token
14+
.. |CircleCI| image:: https://circleci.com/gh/scikit-learn/scikit-learn/tree/main.svg?style=shield&circle-token=:circle-token
1515
.. _CircleCI: https://circleci.com/gh/scikit-learn/scikit-learn
1616

1717
.. |Nightly wheels| image:: https://github.com/scikit-learn/scikit-learn/workflows/Wheel%20builder/badge.svg?event=schedule

asv_benchmarks/asv.conf.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// The URL or local path of the source code repository for the
1313
// project being benchmarked
1414
"repo": "..",
15-
15+
1616
// The Python project's subdirectory in your repo. If missing or
1717
// the empty string, the project is assumed to be located at the root
1818
// of the repository.
@@ -28,9 +28,9 @@
2828
// "PIP_NO_BUILD_ISOLATION=false python -mpip wheel --no-deps --no-index -w {build_cache_dir} {build_dir}"
2929
// ],
3030

31-
// List of branches to benchmark. If not provided, defaults to "master"
31+
// List of branches to benchmark. If not provided, defaults to "master
3232
// (for git) or "default" (for mercurial).
33-
// "branches": ["master"], // for git
33+
// "branches": ["main"], // for git
3434
// "branches": ["default"], // for mercurial
3535

3636
// The DVCS being used. If not set, it will be automatically

azure-pipelines.yml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ schedules:
44
displayName: Run nightly build
55
branches:
66
include:
7-
- master
7+
- main
88
always: true
99

1010
jobs:
@@ -78,6 +78,28 @@ jobs:
7878
# Here we make sure, that they are still run on a regular basis.
7979
SKLEARN_SKIP_NETWORK_TESTS: '0'
8080

81+
# Check compilation with intel C++ compiler (ICC)
82+
- template: build_tools/azure/posix.yml
83+
parameters:
84+
name: Linux_Nightly_ICC
85+
vmImage: ubuntu-18.04
86+
dependsOn: [git_commit, linting]
87+
condition: |
88+
and(
89+
succeeded(),
90+
not(contains(dependencies['git_commit']['outputs']['commit.message'], '[ci skip]')),
91+
or(eq(variables['Build.Reason'], 'Schedule'),
92+
contains(dependencies['git_commit']['outputs']['commit.message'], '[icc-build]')
93+
)
94+
)
95+
matrix:
96+
pylatest_conda_mkl:
97+
DISTRIB: 'conda'
98+
PYTHON_VERSION: '*'
99+
BLAS: 'mkl'
100+
COVERAGE: 'false'
101+
BUILD_WITH_ICC: 'true'
102+
81103
# Will run all the time regardless of linting outcome.
82104
- template: build_tools/azure/posix.yml
83105
parameters:

build_tools/azure/install.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,20 @@ if [[ "$DISTRIB" == "conda-pip-latest" ]]; then
148148
# environment:
149149
pip install --verbose --editable .
150150
else
151+
if [[ "$BUILD_WITH_ICC" == "true" ]]; then
152+
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
153+
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
154+
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
155+
sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main"
156+
sudo apt-get update
157+
sudo apt-get install intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic
158+
source /opt/intel/oneapi/setvars.sh
159+
160+
# The "build_clib" command is implicitly used to build "libsvm-skl".
161+
# To compile with a different compiler, we also need to specify the
162+
# compiler for this command
163+
python setup.py build_ext --compiler=intelem -i build_clib --compiler=intelem
164+
fi
151165
# Use the pre-installed build dependencies and build directly in the
152166
# current environment.
153167
python setup.py develop

build_tools/azure/test_docs.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,8 @@ elif [[ "$DISTRIB" == "ubuntu" ]]; then
88
source $VIRTUALENV/bin/activate
99
fi
1010

11+
if [[ "$BUILD_WITH_ICC" == "true" ]]; then
12+
source /opt/intel/oneapi/setvars.sh
13+
fi
14+
1115
make test-doc

build_tools/azure/test_script.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ elif [[ "$DISTRIB" == "ubuntu" ]] || [[ "$DISTRIB" == "ubuntu-32" ]]; then
88
source $VIRTUALENV/bin/activate
99
fi
1010

11+
if [[ "$BUILD_WITH_ICC" == "true" ]]; then
12+
source /opt/intel/oneapi/setvars.sh
13+
fi
14+
1115
python --version
1216
python -c "import numpy; print('numpy %s' % numpy.__version__)"
1317
python -c "import scipy; print('scipy %s' % scipy.__version__)"

build_tools/circle/build_doc.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ set -e
99
# instead of relying on the subsequent rules.
1010
#
1111
# We always build the documentation for jobs that are not related to a specific
12-
# PR (e.g. a merge to master or a maintenance branch).
12+
# PR (e.g. a merge to main or a maintenance branch).
1313
#
1414
# If this is a PR, do a full build if there are some files in this PR that are
1515
# under the "doc/" or "examples/" folders, otherwise perform a quick build.
@@ -49,8 +49,8 @@ get_build_type() {
4949
echo BUILD: not a pull request
5050
return
5151
fi
52-
git_range="origin/master...$CIRCLE_SHA1"
53-
git fetch origin master >&2 || (echo QUICK BUILD: failed to get changed filenames for $git_range; return)
52+
git_range="origin/main...$CIRCLE_SHA1"
53+
git fetch origin main >&2 || (echo QUICK BUILD: failed to get changed filenames for $git_range; return)
5454
filenames=$(git diff --name-only $git_range)
5555
if [ -z "$filenames" ]
5656
then
@@ -114,7 +114,7 @@ then
114114
exit 0
115115
fi
116116

117-
if [[ "$CIRCLE_BRANCH" =~ ^master$|^[0-9]+\.[0-9]+\.X$ && -z "$CI_PULL_REQUEST" ]]
117+
if [[ "$CIRCLE_BRANCH" =~ ^main$|^[0-9]+\.[0-9]+\.X$ && -z "$CI_PULL_REQUEST" ]]
118118
then
119119
# ZIP linked into HTML
120120
make_args=dist
@@ -188,9 +188,9 @@ python setup.py develop
188188

189189
export OMP_NUM_THREADS=1
190190

191-
if [[ "$CIRCLE_BRANCH" =~ ^master$ && -z "$CI_PULL_REQUEST" ]]
191+
if [[ "$CIRCLE_BRANCH" =~ ^main$ && -z "$CI_PULL_REQUEST" ]]
192192
then
193-
# List available documentation versions if on master
193+
# List available documentation versions if on main
194194
python build_tools/circle/list_versions.py > doc/versions.rst
195195
fi
196196

@@ -205,7 +205,7 @@ cd -
205205
set +o pipefail
206206

207207
affected_doc_paths() {
208-
files=$(git diff --name-only origin/master...$CIRCLE_SHA1)
208+
files=$(git diff --name-only origin/main...$CIRCLE_SHA1)
209209
echo "$files" | grep ^doc/.*\.rst | sed 's/^doc\/\(.*\)\.rst$/\1.html/'
210210
echo "$files" | grep ^examples/.*.py | sed 's/^\(.*\)\.py$/auto_\1.html/'
211211
sklearn_files=$(echo "$files" | grep '^sklearn/')
@@ -216,7 +216,7 @@ affected_doc_paths() {
216216
}
217217

218218
affected_doc_warnings() {
219-
files=$(git diff --name-only origin/master...$CIRCLE_SHA1)
219+
files=$(git diff --name-only origin/main...$CIRCLE_SHA1)
220220
# Look for sphinx warnings only in files affected by the PR
221221
if [ -n "$files" ]
222222
then

0 commit comments

Comments
 (0)
0