File tree 2 files changed +24
-0
lines changed
2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ dist: xenial
10
10
env :
11
11
TOXENV=py
12
12
EXTRA_ARGS="-n 12"
13
+ TEST_MYPYC=0
13
14
14
15
jobs :
15
16
include :
34
35
- TOXENV=py
35
36
- EXTRA_ARGS="-n 12"
36
37
- NEWSEMANAL=1
38
+ - name : " run test suite with python 3.7 (compiled with mypyc)"
39
+ python : 3.7
40
+ env :
41
+ - TOXENV=py
42
+ - EXTRA_ARGS="-n 12"
43
+ - TEST_MYPYC=1
37
44
- name : " run test suite with python 3.8-dev"
38
45
python : 3.8-dev
39
46
- name : " type check our own code"
@@ -64,6 +71,11 @@ install:
64
71
- pip install -U pip setuptools
65
72
- pip install -U tox==3.9.0
66
73
- tox --notest
74
+ # This is a big hack and only works because the layout of our directories
75
+ # means that tox picks up the mypy from the source directories instead of
76
+ # the version it installed into a venv. This is also *why* we need to do this,
77
+ # since if we arranged for tox to build with mypyc, pytest wouldn't use it.
78
+ - if [[ $TEST_MYPYC == 1 ]]; then pip install -r mypyc-requirements.txt; CC=clang MYPYC_OPT_LEVEL=0 python3 setup.py --use-mypyc build_ext --inplace; fi
67
79
68
80
script :
69
81
- tox -- $EXTRA_ARGS
Original file line number Diff line number Diff line change
1
+ """A basic check to make sure that we are using a mypyc-compiled version when expected."""
2
+
3
+ import mypy
4
+
5
+ from unittest import TestCase
6
+ import os
7
+
8
+
9
+ class MypycTest (TestCase ):
10
+ def test_using_mypyc (self ) -> None :
11
+ if os .getenv ('TEST_MYPYC' , None ) == '1' :
12
+ assert not mypy .__file__ .endswith ('.py' ), "Expected to find a mypyc-compiled version"
You can’t perform that action at this time.
0 commit comments