Skip to content

Commit 133e597

Browse files
committed
pyximport for test helper cython extensions
Allows cython extension to be built for unit tests without having it in the setup.
1 parent e250353 commit 133e597

3 files changed

Lines changed: 5 additions & 1 deletion

File tree

setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,6 @@ def run_setup(extensions):
273273
for m in cython_candidates],
274274
exclude_failures=True))
275275
extensions.extend(cythonize("cassandra/*.pyx"))
276-
extensions.extend(cythonize("tests/unit/cython/*.pyx"))
277276
except Exception:
278277
sys.stderr.write("Cython is not installed. Not compiling core driver files as extensions (optional).")
279278

tests/unit/cython/utils.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414

1515
from cassandra.cython_deps import HAVE_CYTHON, HAVE_NUMPY
1616

17+
if HAVE_CYTHON:
18+
import pyximport
19+
pyximport.install()
20+
1721
try:
1822
import unittest2 as unittest
1923
except ImportError:

tox.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ deps = nose
1111
deps = {[base]deps}
1212
sure
1313
blist
14+
cython
1415
py26: unittest2
1516
py{26,27}: gevent
1617
twisted

0 commit comments

Comments
 (0)