8000 Merge branch 'master' of https://github.com/scikit-learn/scikit-learn… · scikit-learn/scikit-learn@4b2b050 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4b2b050

Browse files
author
Gaurav Chawla
committed
Merge branch 'master' of https://github.com/scikit-learn/scikit-learn into issue_14257
2 parents aeafae7 + 1fca00b commit 4b2b050

Some content is hidden

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

63 files changed

+844
-366
lines changed

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
blank_issues_enabled: false
22
contact_links:
3+
- name: Discussions
4+
url: https://github.com/scikit-learn/scikit-learn/discussions
5+
about: Ask questions and discuss with other scikit-learn community members
36
- name: Stack overflow
47
url: https://stackoverflow.com/questions/tagged/scikit-learn
58
about: Please ask and answer usage questions on stackoverflow

.github/workflows/wheels.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ jobs:
8686
OPENBLAS_NUM_THREADS=2
8787
SKLEARN_SKIP_NETWORK_TESTS=1
8888
SKLEARN_BUILD_PARALLEL=3
89+
MACOSX_DEPLOYMENT_TARGET=10.13
8990
CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.platform_id }}
9091
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: bash build_tools/github/repair_windows_wheels.sh {wheel} {dest_dir} ${{ matrix.bitness }}
9192
CIBW_BEFORE_TEST_WINDOWS: bash build_tools/github/build_minimal_windows_image.sh ${{ matrix.python }} ${{ matrix.bitness }}

.travis.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,21 @@ jobs:
3636
- BUILD_WITH_ICC=true
3737
if: type = cron OR commit_message =~ /\[icc-build\]/
3838

39-
- python: 3.7
39+
# Manual trigger of linux/arm64 tests in PR without triggering the full
40+
# wheel building process for all the Python versions.
41+
- python: 3.9
4042
os: linux
4143
arch: arm64
42-
if: type = cron OR commit_message =~ /\[arm64\]/
44+
if: commit_message =~ /\[arm64\]/
4345
env:
4446
- CPU_COUNT=8
4547

46-
# Linux environments to build the scikit-learn wheels
47-
# for the ARM64 arquitecture and Python 3.6 and newer
48+
# Linux environments to build the scikit-learn wheels for the ARM64
49+
# architecture and Python 3.6 and newer. This is used both at release time
50+
# 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
52+
# weekly frequency is meant to avoid depleting the Travis CI credits too
53+
# fast.
4854
- python: 3.6
4955
os: linux
5056
arch: arm64

azure-pipelines.yml

Lines changed: 71 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -8,66 +8,65 @@ schedules:
88
always: true
99

1010
jobs:
11-
- job: linting
12-
displayName: Linting
11+
- job: git_commit
12+
displayName: Get Git Commit
1313
pool:
1414
vmImage: ubuntu-18.04
1515
steps:
16-
- task: UsePythonVersion@0
17-
inputs:
18-
versionSpec: '3.9'
19-
- bash: |
20-
pip install flake8 mypy==0.782
21-
displayName: Install linters
2216
- bash: |
2317
set -ex
2418
if [[ $BUILD_REASON == "PullRequest" ]]; then
2519
# By default pull requests use refs/pull/PULL_ID/merge as the source branch
2620
# which has a "Merge ID into ID" as a commit message. The latest commit
2721
# message is the second to last commit
2822
COMMIT_ID=$(echo $BUILD_SOURCEVERSIONMESSAGE | awk '{print $2}')
29-
COMMIT_MESSAGE=$(git log $COMMIT_ID -1 --pretty=%B)
23+
message=$(git log $COMMIT_ID -1 --pretty=%B)
3024
else
31-
COMMIT_MESSAGE=$BUILD_SOURCEVERSIONMESSAGE
25+
message=$BUILD_SOURCEVERSIONMESSAGE
3226
fi
33-
echo "##vso[task.setvariable variable=COMMIT_MESSAGE]$COMMIT_MESSAGE"
27+
echo "##vso[task.setvariable variable=message;isOutput=true]$message"
28+
name: commit
3429
displayName: Get source version message
30+
31+
- job: linting
32+
dependsOn: [git_commit]
33+
condition: |
34+
and(
35+
succeeded(),
36+
not(contains(dependencies['git_commit']['outputs']['commit.message'], '[lint skip]')),
37+
not(contains(dependencies['git_commit']['outputs']['commit.message'], '[ci skip]'))
38+
)
39+
displayName: Linting
40+
pool:
41+
vmImage: ubuntu-18.04
42+
steps:
43+
- task: UsePythonVersion@0
44+
inputs:
45+
versionSpec: '3.9'
3546
- bash: |
36-
set -ex
37-
if [[ "$COMMIT_MESSAGE" =~ "[lint skip]" ]]; then
38-
# skip linting
39-
echo "Skipping flake8 linting"
40-
exit 0
41-
else
42-
./build_tools/circle/linting.sh
43-
fi
47+
pip install flake8 mypy==0.782
48+
displayName: Install linters
49+
- bash: |
50+
./build_tools/circle/linting.sh
4451
displayName: Run linting
4552
- bash: |
46-
set -ex
47-
if [[ "$COMMIT_MESSAGE" =~ "[lint skip]" ]]; then
48-
# skip linting
49-
echo "Skipping mypy linting"
50-
exit 0
51-
else
52-
mypy sklearn/
53-
fi
53+
mypy sklearn/
5454
displayName: Run mypy
55-
- bash: |
56-
if [[ "$COMMIT_MESSAGE" =~ "[scipy-dev]" ]] || [[ $BUILD_REASON == "Schedule" ]]; then
57-
echo "Running scipy-dev"
58-
echo "##vso[task.setvariable variable=runScipyDev;isOutput=true]true"
59-
else
60-
echo "##vso[task.setvariable variable=runScipyDev;isOutput=true]false"
61-
fi
62-
name: gitCommitMessage
63-
displayName: Determine to run scipy-dev
6455
6556
- template: build_tools/azure/posix.yml
6657
parameters:
6758
name: Linux_Nightly
6859
vmImage: ubuntu-18.04
69-
dependsOn: [linting]
70-
condition: eq(dependencies['linting']['outputs']['gitCommitMessage.runScipyDev'], 'true')
60+
dependsOn: [git_commit, linting]
61+
condition: |
62+
and(
63+
succeeded(),
64+
not(contains(dependencies['git_commit']['outputs']['commit.message'], '[ci skip]')),
65+
or(eq(variables['Build.Reason'], 'Schedule'),
66+
contains(dependencies['git_commit']['outputs']['commit.message'], '[scipy-dev]'
67+
)
68+
)
69+
)
7170
matrix:
7271
pylatest_pip_scipy_dev:
7372
DISTRIB: 'conda-pip-scipy-dev'
@@ -84,6 +83,12 @@ jobs:
8483
parameters:
8584
name: Linux_Runs
8685
vmImage: ubuntu-18.04
86+
dependsOn: [git_commit]
87+
condition: |
88+
and(
89+
succeeded(),
90+
not(contains(dependencies['git_commit']['outputs']['commit.message'], '[ci skip]'))
91+
)
8792
matrix:
8893
pylatest_conda_mkl:
8994
DISTRIB: 'conda'
@@ -95,8 +100,13 @@ jobs:
95100
parameters:
96101
name: Linux
97102
vmImage: ubuntu-18.04
98-
dependsOn: [linting]
99-
condition: and(ne(variables['Build.Reason'], 'Schedule'), succeeded('linting'))
103+
dependsOn: [linting, git_commit]
104+
condition: |
105+
and(
106+
succeeded(),
107+
not(contains(dependencies['git_commit']['outputs']['commit.message'], '[ci skip]')),
108+
ne(variables['Build.Reason'], 'Schedule')
109+
)
100110
matrix:
101111
# Linux environment to test that scikit-learn can be built against
102112
# versions of numpy, scipy with ATLAS that comes with Ubuntu Bionic 18.04
@@ -139,8 +149,13 @@ jobs:
139149
parameters:
140150
name: Linux32
141151
vmImage: ubuntu-18.04
142-
dependsOn: [linting]
143-
condition: and(ne(variables['Build.Reason'], 'Schedule'), succeeded('linting'))
152+
dependsOn: [linting, git_commit]
153+
condition: |
154+
and(
155+
succeeded(),
156+
not(contains(dependencies['git_commit']['outputs']['commit.message'], '[ci skip]')),
157+
ne(variables['Build.Reason'], 'Schedule')
158+
)
144159
matrix:
145160
py36_ubuntu_atlas_32bit:
146161
DISTRIB: 'ubuntu-32'
@@ -157,8 +172,13 @@ jobs:
157172
parameters:
158173
name: macOS
159174
vmImage: macOS-10.14
160-
dependsOn: [linting]
161-
condition: and(ne(variables['Build.Reason'], 'Schedule'), succeeded('linting'))
175+
dependsOn: [linting, git_commit]
176+
condition: |
177+
and(
178+
succeeded(),
179+
not(contains(dependencies['git_commit']['outputs']['commit.message'], '[ci skip]')),
180+
ne(variables['Build.Reason'], 'Schedule')
181+
)
162182
matrix:
163183
pylatest_conda_forge_mkl:
164184
DISTRIB: 'conda'
@@ -174,8 +194,13 @@ jobs:
174194
parameters:
175195
name: Windows
176196
vmImage: vs2017-win2016
177-
dependsOn: [linting]
178-
condition: and(ne(variables['Build.Reason'], 'Schedule'), succeeded('linting'))
197+
dependsOn: [linting, git_commit]
198+
condition: |
199+
and(
200+
succeeded(),
201+
not(contains(dependencies['git_commit']['outputs']['commit.message'], '[ci skip]')),
202+
ne(variables['Build.Reason'], 'Schedule')
203+
)
179204
matrix:
180205
py37_conda_mkl:
181206
PYTHON_VERSION: '3.7'

build_tools/azure/install.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,11 @@ elif [[ "$DISTRIB" == "conda-pip-scipy-dev" ]]; then
9696
python -m pip install -U pip
9797
echo "Installing numpy and scipy master wheels"
9898
dev_anaconda_url=https://pypi.anaconda.org/scipy-wheels-nightly/simple
99-
pip install --pre --upgrade --timeout=60 --extra-index $dev_anaconda_url numpy scipy pandas
99+
pip install --pre --upgrade --timeout=60 --extra-index $dev_anaconda_url numpy pandas
100+
101+
# issue with metadata in scipy dev builds https://github.com/scipy/scipy/issues/13196
102+
# --use-deprecated=legacy-resolver needs to be included
103+
pip install --pre --upgrade --timeout=60 --extra-index $dev_anaconda_url scipy --use-deprecated=legacy-resolver
100104
pip install --pre cython
101105
setup_ccache
102106
echo "Installing joblib master"

build_tools/circle/build_doc.sh

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ fi
116116

117117
if [[ "$CIRCLE_BRANCH" =~ ^master$|^[0-9]+\.[0-9]+\.X$ && -z "$CI_PULL_REQUEST" ]]
118118
then
119-
# PDF linked into HTML
120-
make_args="dist LATEXMKOPTS=-halt-on-error"
119+
# ZIP linked into HTML
120+
make_args=dist
121121
elif [[ "$build_type" =~ ^QUICK ]]
122122
then
123123
make_args=html-noplot
@@ -133,13 +133,10 @@ fi
133133
make_args="SPHINXOPTS=-T $make_args" # show full traceback on exception
134134

135135
# Installing required system packages to support the rendering of math
136-
# notation in the HTML documentation
136+
# notation in the HTML documentation and to optimize the image files
137137
sudo -E apt-get -yq update
138-
sudo -E apt-get -yq remove texlive-binaries --purge
139138
sudo -E apt-get -yq --no-install-suggests --no-install-recommends \
140-
install dvipng texlive-latex-base texlive-latex-extra \
141-
texlive-latex-recommended texlive-fonts-recommended \
142-
latexmk gsfonts ccache
139+
install dvipng gsfonts ccache zip optipng
143140

144141
# deactivate circleci virtualenv and setup a miniconda env instead
145142
if [[ `type -t deactivate` ]]; then

build_tools/circle/list_versions.py

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from distutils.version import LooseVersion
99
from urllib.request import urlopen
1010

11+
1112
def json_urlread(url):
1213
try:
1314
return json.loads(urlopen(url).read().decode('utf8'))
@@ -32,10 +33,23 @@ def human_readable_data_quantity(quantity, multiple=1024):
3233
quantity /= multiple
3334

3435

35-
def get_pdf_size(version):
36+
def get_file_extension(version):
37+
if 'dev' in version:
38+
# The 'dev' branch should be explictly handled
39+
return 'zip'
40+
41+
current_version = LooseVersion(version)
42+
min_zip_version = LooseVersion('1.0.0')
43+
44+
return 'zip' if current_version >= min_zip_version else 'pdf'
45+
46+
47+
def get_file_size(version):
3648
api_url = ROOT_URL + '%s/_downloads' % version
3749
for path_details in json_urlread(api_url):
38-
if path_details['name'] == 'scikit-learn-docs.pdf':
50+
file_extension = get_file_extension(version)
51+
file_path = f'scikit-learn-docs.{file_extension}'
52+
if path_details['name'] == file_path:
3953
return human_readable_data_quantity(path_details['size'], 1000)
4054

4155

@@ -64,8 +78,8 @@ def get_pdf_size(version):
6478
if path_details['type'] == 'dir':
6579
html = urlopen(RAW_FMT % name).read().decode('utf8')
6680
version_num = VERSION_RE.search(html).group(1)
67-
pdf_size = get_pdf_size(name)
68-
dirs[name] = (version_num, pdf_size)
81+
file_size = get_file_size(name)
82+
dirs[name] = (version_num, file_size)
6983

7084
if path_details['type'] == 'symlink':
7185
symlinks[name] = json_urlread(path_details['_links']['self'])['target']
@@ -81,7 +95,7 @@ def get_pdf_size(version):
8195
for name in (NAMED_DIRS +
8296
sorted((k for k in dirs if k[:1].isdigit()),
8397
key=LooseVersion, reverse=True)):
84-
version_num, pdf_size = dirs[name]
98+
version_num, file_size = dirs[name]
8599
if version_num in seen:
86100
# symlink came first
87101
continue
@@ -91,7 +105,8 @@ def get_pdf_size(version):
91105
path = 'https://scikit-learn.org/%s/' % name
92106
out = ('* `Scikit-learn %s%s documentation <%s>`_'
93107
% (version_num, name_display, path))
94-
if pdf_size is not None:
95-
out += (' (`PDF %s <%s/_downloads/scikit-learn-docs.pdf>`_)'
96-
% (pdf_size, path))
108+
if file_size is not None:
109+
file_extension = get_file_extension(version_num)
110+
out += (f' (`{file_extension.upper()} {file_size} <{path}/'
111+
f'_downloads/scikit-learn-docs.{file_extension}>`_)')
97112
print(out)

build_tools/github/build_wheels.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,15 @@ set -x
55

66
# OpenMP is not present on macOS by default
77
if [[ "$RUNNER_OS" == "macOS" ]]; then
8-
brew install libomp
8+
# Make sure to use a libomp version binary compatible with the oldest
9+
# supported version of the macos SDK as libomp will be vendored into the
10+
# scikit-learn wheels for macos. The list of bottles can be found at:
11+
# https://formulae.brew.sh/api/formula/libomp.json. Currently, the oldest
12+
# supported macos version is: High Sierra / 10.13. When upgrading this, be
13+
# sure to update the MACOSX_DEPLOYMENT_TARGET environment variable in
14+
# wheels.yml accordingly.
15+
wget https://homebrew.bintray.com/bottles/libomp-11.0.0.high_sierra.bottle.tar.gz
16+
brew install libomp-11.0.0.high_sierra.bottle.tar.gz
917
export CC=/usr/bin/clang
1018
export CXX=/usr/bin/clang++
1119
export CPPFLAGS="$CPPFLAGS -Xpreprocessor -fopenmp"

build_tools/travis/install_master.sh

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -50,23 +50,8 @@ conda update --yes conda
5050
conda create -n testenv --yes python=3.7
5151

5252
source activate testenv
53-
54-
if [[ $TRAVIS_CPU_ARCH == amd64 ]]; then
55-
echo "Upgrading pip and setuptools."
56-
pip install --upgrade pip setuptools
57-
echo "Installing numpy, scipy and pandas master wheels."
58-
dev_anaconda_url=https://pypi.anaconda.org/scipy-wheels-nightly/simple
59-
pip install --pre --upgrade --timeout=60 --extra-index $dev_anaconda_url numpy scipy pandas
60-
echo "Installing cython pre-release wheels."
61-
pip install --pre cython
62-
echo "Installing joblib master."
63-
pip install https://github.com/joblib/joblib/archive/master.zip
64-
echo "Installing pillow master."
65-
pip install https://github.com/python-pillow/Pillow/archive/master.zip
66-
else
67-
conda install -y scipy numpy pandas cython
68-
pip install joblib threadpoolctl
69-
fi
53+
conda install -y scipy numpy pandas cython
54+
pip install joblib threadpoolctl
7055

7156
pip install $(get_dep pytest $PYTEST_VERSION) pytest-xdist
7257

0 commit comments

Comments
 (0)
0