8000 MNT Only checks warnings on latest depedendencies versions in CI (#12… · lithuak/scikit-learn@722211a · GitHub
[go: up one dir, main page]

Skip to content

Commit 722211a

Browse files
rthjnothman
authored andcommitted
MNT Only checks warnings on latest depedendencies versions in CI (scikit-learn#12048)
1 parent 8e1e643 commit 722211a

File tree

5 files changed

+18
-11
lines changed

5 files changed

+18
-11
lines changed

.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

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/travis/install.sh

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,7 @@ elif [[ "$DISTRIB" == "ubuntu" ]]; then
8484
# and scipy
8585
virtualenv --system-site-packages testvenv
8686
source testvenv/bin/activate
87-
# FIXME: Importing scipy.sparse with numpy 1.8.2 and scipy 0.13.3 produces
88-
# a deprecation warning and the test suite fails on such warnings.
89-
# To test these numpy/scipy versions, we use pytest<3.8 as it has
90-
# a known limitation/bug of not capturing warnings during test collection.
91-
pip install pytest==3.7.4 pytest-cov cython==$CYTHON_VERSION
87+
pip install pytest pytest-cov cython==$CYTHON_VERSION
9288

9389
elif [[ "$DISTRIB" == "scipy-dev" ]]; then
9490
make_conda python=3.7

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

setup.cfg

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ addopts =
1212
--doctest-modules
1313
--disable-pytest-warnings
1414
-rs
15-
filterwarnings =
16-
error::DeprecationWarning
17-
error::FutureWarning
1815

1916
[wheelhouse_uploader]
2017
artifact_indexes=

0 commit comments

Comments
 (0)
0