8000 0.20postrc again (#12151) · scikit-learn/scikit-learn@8d8939b · GitHub
[go: up one dir, main page]

Skip to content

Commit 8d8939b

Browse files
authored
0.20postrc again (#12151)
Continuation of #11948
1 parent c196ec4 commit 8d8939b

File tree

114 files changed

+1939
-1051
lines changed

Some content is hidden

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

114 files changed

+1939
-1051
lines changed

.circleci/config.yml

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,12 @@ jobs:
4141
# Test examples run with minimal dependencies
4242
- MINICONDA_PATH: ~/miniconda
4343
- CONDA_ENV_NAME: testenv
44-
- PYTHON_VERSION: 2
45-
- NUMPY_VERSION: 1.8.2
46-
# XXX: plot_gpc_xor.py fails with scipy 0.13.3
47-
- SCIPY_VERSION: 0.14
48-
- MATPLOTLIB_VERSION: 1.3
49-
- SCIKIT_IMAGE_VERSION: 0.9.3
50-
- PANDAS_VERSION: 0.13.1
44+
- PYTHON_VERSION: "2"
45+
- NUMPY_VERSION: "1.10"
46+
- SCIPY_VERSION: "0.16"
47+
- MATPLOTLIB_VERSION: "1.4"
48+
- SCIKIT_IMAGE_VERSION: "0.11"
49+
- PANDAS_VERSION: "0.17.1"
5150
steps:
5251
- checkout
5352
- run: ./build_tools/circle/checkout_merge_commit.sh
@@ -65,6 +64,21 @@ jobs:
6564
path: ~/log.txt
6665
destination: log.txt
6766

67+
pypy3:
68+
docker:
69+
- image: pypy:3-6.0.0
70+
steps:
71+
- restore_cache:
72+
keys:
73+
- pypy3-ccache-{{ .Branch }}
74+
- pypy3-ccache
75+
- checkout
76+
- run: ./build_tools/circle/build_test_pypy.sh
77+
- save_cache:
78+
key: pypy3-ccache-{{ .Branch }}-{{ .BuildNum }}
79+
paths:
80+
- ~/.ccache
81+
- ~/.cache/pip
6882

6983
deploy:
7084
docker:
@@ -89,6 +103,21 @@ workflows:
89103
jobs:
90104
- python3
91105
- python2
106+
- pypy3:
107+
filters:
108+
branches:
109+
only:
110+
- 0.20.X
92111
- deploy:
93112
requires:
94113
- python3
114+
pypy:
115+
triggers:
116+
- schedule:
117+
cron: "0 0 * * *"
118+
filters:
119+
branches:
120+
only:
121+
- master
122+
jobs:
123+
- pypy3

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ matrix:
4646
CYTHON_VERSION="*" PYAMG_VERSION="*" PILLOW_VERSION="*"
4747
JOBLIB_VERSION="*" COVERAGE=true
4848
CHECK_PYTEST_SOFT_DEPENDENCY="true" TEST_DOCSTRINGS="true"
49-
SKLEARN_SITE_JOBLIB=1
49+
SKLEARN_SITE_JOBLIB=1 CHECK_WARNINGS="true"
5050
if: type != cron
5151
# flake8 linting on diff wrt common ancestor with upstream/master
5252
- env: RUN_FLAKE8="true" SKIP_TESTS="true"
@@ -58,7 +58,7 @@ matrix:
5858
# installed from their CI wheels in a virtualenv with the Python
5959
# interpreter provided by travis.
6060
- python: 3.6
61-
env: DISTRIB="scipy-dev"
61+
env: DISTRIB="scipy-dev" CHECK_WARNINGS="true"
6262
if: type = cron OR commit_message =~ /\[scipy-dev\]/
6363

6464
install: source build_tools/travis/install.sh

AUTHORS.rst

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

README.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ scikit-learn requires:
5656
**Scikit-learn 0.20 is the last version to support Python2.7.**
5757
Scikit-learn 0.21 and later will require Python 3.5 or newer.
5858

59-
For running the examples Matplotlib >= 1.3.1 is required. A few examples
60-
require scikit-image >= 0.9.3 and a few examples require pandas >= 0.13.1.
59+
For running the examples Matplotlib >= 1.4 is required. A few examples
60+
require scikit-image >= 0.11.3 and a few examples require pandas >= 0.17.1.
6161

6262
scikit-learn also uses CBLAS, the C interface to the Basic Linear Algebra
6363
Subprograms library. scikit-learn comes with a reference implementation, but
@@ -120,7 +120,7 @@ Testing
120120
~~~~~~~
121121

122122
After installation, you can launch the test suite from outside the
123-
source directory (you will need to have the ``pytest`` package installed)::
123+
source directory (you will need to have ``pytest`` >= 3.3.0 installed)::
124124

125125
pytest sklearn
126126

appveyor.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ environment:
2020
- PYTHON: "C:\\Python37-x64"
2121
PYTHON_VERSION: "3.7.0"
2222
PYTHON_ARCH: "64"
23+
CHECK_WARNINGS: "true"
2324

2425
- PYTHON: "C:\\Python27"
2526
PYTHON_VERSION: "2.7.8"
@@ -72,7 +73,13 @@ test_script:
7273
# installed library.
7374
- mkdir "../empty_folder"
7475
- cd "../empty_folder"
75-
- pytest --showlocals --durations=20 --pyargs sklearn
76+
- ps: >-
77+
if (Test-Path variable:global:CHECK_WARNINGS) {
78+
$env:PYTEST_ARGS = "-Werror::DeprecationWarning -Werror::FutureWarning"
79+
} else {
80+
$env:PYTEST_ARGS = ""
81+
}
82+
- "pytest --showlocals --durations=20 %PYTEST_ARGS% --pyargs sklearn"
7683
# Move back to the project folder
7784
- cd "../scikit-learn"
7885

build_tools/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Makefile for maintenance tools
2+
3+
authors:
4+
python generate_authors_table.py > ../doc/authors.rst

build_tools/circle/build_test_pypy.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,16 @@ source pypy-env/bin/activate
1818
python --version
1919
which python
2020

21-
pip install --extra-index https://antocuni.github.io/pypy-wheels/ubuntu numpy==1.14.4 Cython pytest
21+
pip install --extra-index https://antocuni.github.io/pypy-wheels/ubuntu numpy Cython pytest
2222
pip install "scipy>=1.1.0" sphinx numpydoc docutils
2323

2424
ccache -M 512M
2525
export CCACHE_COMPRESS=1
2626
export PATH=/usr/lib/ccache:$PATH
27+
export LOKY_MAX_CPU_COUNT="2"
2728

28-
pip install -e .
29+
pip install -vv -e .
2930

30-
make test
31+
python -m pytest sklearn/
32+
python -m pytest doc/sphinxext/
33+
python -m pytest $(find doc -name '*.rst' | sort)

build_tools/generate_authors_table.py

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
"""
2+
This script generates an html table of contributors, with names and avatars.
3+
The list is generated from scikit-learn's teams on GitHub, plus a small number
4+
of hard-coded contributors.
5+
6+
The table should be updated for each new inclusion in the teams.
7+
Generating the table requires admin rights.
8+
"""
9+
from __future__ import print_function
10+
11+
import sys
12+
import requests
13+
import getpass
14+
15+
try:
16+
# With authentication: up to 5000 requests per hour.
17+
print("user:", file=sys.stderr)
18+
user = input()
19+
passwd = getpass.getpass()
20+
auth = (user, passwd)
21+
except IndexError:
22+
# Without authentication: up to 60 requests per hour.
23+
auth = None
24+
25+
ROW_SIZE = 7
26+
LOGO_URL = 'https://avatars2.githubusercontent.com/u/365630?v=4'
27+
28+
29+
def group_iterable(iterable, size):
30+
"""Group iterable into lines"""
31+
group = []
32+
for element in iterable:
33+
group.append(element)
34+
if len(group) == size:
35+
yield group
36+
group = []
37+
if len(group) != 0:
38+
yield group
39+
40+
41+
def get_contributors():
42+
"""Get the list of contributor profiles. Require admin rights."""
43+
# get members of scikit-learn teams on GitHub
44+
members = []
45+
for team in [11523, 33471]:
46+
for page in [1, 2]: # 30 per page
47+
members.extend(requests.get(
48+
"https://api.github.com/teams/%d/members?page=%d"
49+
% (team, page), auth=auth).json())
50+
51+
# keep only the logins
52+
logins = [c['login'] for c in members]
53+
# add missing contributors with GitHub accounts
54+
logins.extend(['dubourg', 'jarrodmillman', 'mbrucher', 'thouis'])
55+
# add missing contributors without GitHub accounts
56+
logins.extend(['Angel Soler Gollonet'])
57+
# remove duplicate
58+
logins = set(logins)
59+
# remove CI
60+
logins.remove('sklearn-ci')
61+
62+
# get profiles from GitHub
63+
profiles = [get_profile(login) for login in logins]
64+
# sort by last name
65+
profiles = sorted(profiles, key=key)
66+
67+
return profiles
68+
69+
70+
def get_profile(login):
71+
"""Get the GitHub profile from login"""
72+
profile = requests.get("https://api.github.com/users/%s" % login,
73+
auth=auth).json()
74+
if 'name' not in profile:
75+
# default profile if the login does not exist
76+
return dict(name=login, avatar_url=LOGO_URL, html_url="")
77+
else:
78+
if profile["name"] is None:
79+
profile["name"] = profile["login"]
80+
81+
# fix missing names
82+
missing_names = {'bthirion': 'Bertrand Thirion',
83+
'dubourg': 'Vincent Dubourg',
84+
'Duchesnay': 'Edouard Duchesnay',
85+
'Lars': 'Lars Buitinck',
86+
'MechCoder': 'Manoj Kumar'}
87+
if profile["name"] in missing_names:
88+
profile["name"] = missing_names[profile["name"]]
89+
return profile
90+
91+
92+
def key(profile):
93+
"""Get the last name in lower case"""
94+
return profile["name"].split(' ')[-1].lower()
95+
96+
97+
contributors = get_contributors()
98+
99+
print(".. raw :: html\n")
100+
print(" <!-- Generated by gen_authors.py -->")
101+
print(" <table>")
102+
print(" <col style='width:%d%%' span='%d'>"
103+
% (int(100 / ROW_SIZE), ROW_SIZE))
104+
print(" <style>")
105+
print(" img.avatar {border-radius: 10px;}")
106+
print(" td {vertical-align: top;}")
107+
print(" </style>")
108+
for row in group_iterable(contributors, size=ROW_SIZE):
109+
print(" <tr>")
110+
for contributor in row:
111+
print(" <td>")
112+
print(" <a href='%s'><img src='%s' class='avatar' /></a> <br />"
113+
% (contributor["html_url"], contributor["avatar_url"]))
114+
print(" <p>%s</p>" % contributor["name"])
115+
print(" </td>")
116+
print(" </tr>")
117+
print(" </table>")

build_tools/travis/test_script.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,13 @@ run_tests() {
3838
if [[ "$COVERAGE" == "true" ]]; then
3939
TEST_CMD="$TEST_CMD --cov sklearn"
4040
fi
41+
42+
if [[ -n "$CHECK_WARNINGS" ]]; then
43+
TEST_CMD="$TEST_CMD -Werror::DeprecationWarning -Werror::FutureWarning"
44+
fi
45+
46+
set -x # print executed commands to the terminal
47+
4148
$TEST_CMD sklearn
4249

4350
# Going back to git checkout folder needed to test documentation

0 commit comments

Comments
 (0)
0