8000 [MRG] MAINT Python 3.6 fixes (#8123) · scikit-learn/scikit-learn@096a9cb · GitHub
[go: up one dir, main page]

Skip to content

Commit 096a9cb

Browse files
authored
[MRG] MAINT Python 3.6 fixes (#8123)
* FIX dict order dependent doctest * FIX str concat TypeError message changed in Python 3.6 * MAINT upgrade travis config with most recent conda deps
1 parent e088685 commit 096a9cb

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ env:
3333
NUMPY_VERSION="1.6.2" SCIPY_VERSION="0.11.0" CYTHON_VERSION="0.23"
3434
# This environment tests the newest supported anaconda env
3535
# It also runs tests requiring Pandas.
36-
- DISTRIB="conda" PYTHON_VERSION="3.5" INSTALL_MKL="true"
37-
NUMPY_VERSION="1.10.4" SCIPY_VERSION="0.17.0" PANDAS_VERSION="0.18.0"
38-
CYTHON_VERSION="0.23.4"
36+
- DISTRIB="conda" PYTHON_VERSION="3.6" INSTALL_MKL="true"
37+
NUMPY_VERSION="1.11.2" SCIPY_VERSION="0.18.1" PANDAS_VERSION="0.19.1"
38+
CYTHON_VERSION="0.25.2"
3939
# flake8 linting on diff wrt common ancestor with upstream/master
4040
- RUN_FLAKE8="true" SKIP_TESTS="true"
4141
DISTRIB="conda" PYTHON_VERSION="3.5" INSTALL_MKL="true"

build_tools/travis/install.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ if [[ "$DISTRIB" == "conda" ]]; then
5252
# provided versions
5353
if [[ "$INSTALL_MKL" == "true" ]]; then
5454
conda create -n testenv --yes python=$PYTHON_VERSION pip nose \
55-
numpy=$NUMPY_VERSION scipy=$SCIPY_VERSION numpy scipy \
56-
mkl flake8 cython=$CYTHON_VERSION \
55+
numpy=$NUMPY_VERSION scipy=$SCIPY_VERSION \
56+
mkl cython=$CYTHON_VERSION \
5757
${PANDAS_VERSION+pandas=$PANDAS_VERSION}
5858

5959
else
@@ -118,5 +118,5 @@ except ImportError:
118118
fi
119119

120120
if [[ "$RUN_FLAKE8" == "true" ]]; then
121-
conda install flake8
121+
conda install --yes flake8
122122
fi

sklearn/utils/graph.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,11 @@ def single_source_shortest_path_length(graph, source, cutoff=None):
4444
... [ 1, 0, 1, 0],
4545
... [ 0, 1, 0, 1],
4646
... [ 0, 0, 1, 0]])
47-
>>> single_source_shortest_path_length(graph, 0)
48-
{0: 0, 1: 1, 2: 2, 3: 3}
49-
>>> single_source_shortest_path_length(np.ones((6, 6)), 2)
50-
{0: 1, 1: 1, 2: 0, 3: 1, 4: 1, 5: 1}
47+
>>> list(sorted(single_source_shortest_path_length(graph, 0).items()))
48+
[(0, 0), (1, 1), (2, 2), (3, 3)]
49+
>>> graph = np.ones((6, 6))
50+
>>> list(sorted(single_source_shortest_path_length(graph, 2).items()))
51+
[(0, 1), (1, 1), (2, 0), (3, 1), (4, 1), (5, 1)]
5152
"""
5253
if sparse.isspmatrix(graph):
5354
graph = graph.tolil()

sklearn/utils/tests/test_validation.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,8 +345,7 @@ def test_check_array_accept_sparse_type_exception():
345345
assert_raise_message(ValueError, msg.format(()),
346346
check_array, X_csr, accept_sparse=())
347347

348-
msg = "'SVR' object"
349-
assert_raise_message(TypeError, msg,
348+
assert_raise_message(TypeError, "SVR",
350349
check_array, X_csr, accept_sparse=[invalid_type])
351350

352351
# Test deprecation of 'None'

0 commit comments

Comments
 (0)
0