8000 [MRG] MNT Re-enable PyPy CI (#12039) · scikit-learn/scikit-learn@b91cbda · GitHub
[go: up one dir, main page]

Skip to content

Commit b91cbda

Browse files
rthogrisel
authored andcommitted
[MRG] MNT Re-enable PyPy CI (#12039)
1 parent 8068b97 commit b91cbda

File tree

5 files changed

+46
-5
lines changed
  • .circleci
  • build_tools/circle
  • sklearn
    • feature_extraction/tests
    • tests
      • < 8000 a class="fgColor-default prc-Link-Link-85e08" data-muted="true" href="#diff-8348786c244e8422aa6fe89069999269480f83636923aefd9dc1909fb0e802b4" muted="" role="presentation" tabindex="-1" data-analytics-opt-out="true">test_docstring_parameters.py

5 files changed

+46
-5
lines changed

.circleci/config.yml

+30
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,21 @@ jobs:
6565
path: ~/log.txt
6666
destination: log.txt
6767

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

6984
deploy:
7085
docker:
@@ -89,6 +104,21 @@ workflows:
89104
jobs:
90105
- python3
91106
- python2
107+
- pypy3:
108+
filters:
109+
branches:
110+
only:
111+
- 0.20.X
92112
- deploy:
93113
requires:
94114
- python3
115+
pypy:
116+
triggers:
117+
- schedule:
118+
cron: "0 0 * * *"
119+
filters:
120+
branches:
121+
only:
122+
- master
123+
jobs:
124+
- pypy3

build_tools/circle/build_test_pypy.sh

+6-3
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)

conftest.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ def pytest_collection_modifyitems(config, items):
3232
skip_marker = pytest.mark.skip(
3333
reason='FeatureHasher is not compatible with PyPy')
3434
for item in items:
35-
if item.name == 'sklearn.feature_extraction.hashing.FeatureHasher':
35+
if item.name in (
36+
'sklearn.feature_extraction.hashing.FeatureHasher',
37+
'sklearn.feature_extraction.text.HashingVectorizer'):
3638
item.add_marker(skip_marker)
3739

3840
# Skip tests which require internet if the flag is provided

sklearn/feature_extraction/tests/test_text.py

+3
Original file line numberDiff line numberDiff line change
@@ -1108,6 +1108,8 @@ def test_vectorizers_invalid_ngram_range(vec):
11081108
message = ("Invalid value for ngram_range=%s "
11091109
"lower boundary larger than the upper boundary."
11101110
% str(invalid_range))
1111+
if isinstance(vec, HashingVectorizer):
1112+
pytest.xfail(reason='HashingVectorizer not supported on PyPy')
11111113

11121114
assert_raise_message(
11131115
ValueError, message, vec.fit, ["good news everyone"])
@@ -1119,6 +1121,7 @@ def test_vectorizers_invalid_ngram_range(vec):
11191121
ValueError, message, vec.transform, ["good news everyone"])
11201122

11211123

1124+
@fails_if_pypy
11221125
def test_vectorizer_stop_words_inconsistent():
11231126
if PY2:
11241127
lstr = "[u'and', u'll', u've']"

sklearn/tests/test_docstring_parameters.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
from sklearn.utils.testing import ignore_warnings
2020
from sklearn.utils.deprecation import _is_deprecated
2121

22+
import pytest
23+
2224
PUBLIC_MODULES = set([pckg[1] for pckg in walk_packages(prefix='sklearn.',
2325
path=sklearn.__path__)
2426
if not ("._" in pckg[1] or ".tests." in pckg[1])])
@@ -45,7 +47,8 @@
4547

4648
# numpydoc 0.8.0's docscrape tool raises because of collections.abc under
4749
# Python 3.7
48-
@ignore_warnings(category=DeprecationWarning)
50+
@pytest.mark.filterwarnings('ignore::DeprecationWarning')
51+
@pytest.mark.skipif(IS_PYPY, reason='test segfaults on PyPy')
4952
def test_docstring_parameters():
5053
# Test module docstring formatting
5154

0 commit comments

Comments
 (0)
0