Skip to content

Commit e250353

Browse files
committed
Cython required for setup
Abandoning Cython 'extra' in favor of getting it during setup. As an extra, there was no way of making sure it is present while the driver build is executed.
1 parent e75e667 commit e250353

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

setup.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,6 @@ def run_setup(extensions):
216216
keywords='cassandra,cql,orm',
217217
include_package_data=True,
218218
install_requires=dependencies,
219-
extras_require = {'cython': ['Cython']},
220219
tests_require=['nose', 'mock<=1.0.1', 'PyYAML', 'pytz', 'sure'],
221220
classifiers=[
222221
'Development Status :: 5 - Production/Stable',
@@ -260,8 +259,10 @@ def run_setup(extensions):
260259
if "--no-libev" not in sys.argv and not is_windows:
261260
extensions.append(libev_ext)
262261

263-
if "--no-cython" not in sys.argv:
262+
if "--no-cython" not in sys.argv and not os.environ.get('CASS_DRIVER_NO_CYTHON'):
264263
try:
264+
setup(setup_requires=['Cython'])
265+
265266
from Cython.Build import cythonize
266267
cython_candidates = ['cluster', 'concurrent', 'connection', 'cqltypes', 'metadata',
267268
'pool', 'protocol', 'query', 'util']
@@ -273,7 +274,7 @@ def run_setup(extensions):
273274
exclude_failures=True))
274275
extensions.extend(cythonize("cassandra/*.pyx"))
275276
extensions.extend(cythonize("tests/unit/cython/*.pyx"))
276-
except ImportError:
277+
except Exception:
277278
sys.stderr.write("Cython is not installed. Not compiling core driver files as extensions (optional).")
278279

279280
if "--no-extensions" in sys.argv:

tox.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ deps = nose
1111
deps = {[base]deps}
1212
sure
1313
blist
14-
{env:CYTHON_DEP:}
1514
py26: unittest2
1615
py{26,27}: gevent
1716
twisted

0 commit comments

Comments
 (0)