Skip to content

let users specify Cython version#696

Merged
mambocab merged 1 commit into
apache:masterfrom
mambocab:PYTHON-686
Feb 9, 2017
Merged

let users specify Cython version#696
mambocab merged 1 commit into
apache:masterfrom
mambocab:PYTHON-686

Conversation

@mambocab
Copy link
Copy Markdown
Contributor

Adds a CASS_DRIVER_ALLOWED_CYTHON_VERSION "escape hatch" env var that allows users to specify what version of Cython to use.

You can verify this behavior by installing the driver in an environment without Cython installed, then opening the installed driver with

view `python -c 'from cassandra import cluster ; print cluster.__file__'`

and searching for cython. If you install without CASS_DRIVER_ALLOWED_CYTHON_VERSION, the driver is installed with 0.24.1. If you install with CASS_DRIVER_ALLOWED_CYTHON_VERSION=0.25.2, the driver is installed with 0.25.2. (This holds even when you've installed Cython==0.25.2 in the environment you're installing the driver.)

Comment thread setup.py Outdated
user_specified_cython_version = os.environ.get('CASS_DRIVER_ALLOWED_CYTHON_VERSION')
kw['setup_requires'] = ['Cython>=0.20,<0.25' if
user_specified_cython_version is None else
'Cython=={}'.format(user_specified_cython_version)]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for clarity if we need to add more deps in the future. I would do something like:

cython_dep = 'Cython>=0.20,<0.25'
user_specified_cython_version = os.environ.get('CASS_DRIVER_ALLOWED_CYTHON_VERSION')
if user_specified_cython_version:
    cython_dep =  'Cython==%s' % user_specified_cython_version

kw['setup_requires'] = [cython_dep]

Note that In the whole code base, we use the old style formatting ('%s' % 'hello'), so better to stick to that here as well.

@mambocab
Copy link
Copy Markdown
Contributor Author

mambocab commented Feb 9, 2017

Thanks for the review! I've addressed your comments; if they look good to you I'll squash and merge.

@aboudreault
Copy link
Copy Markdown
Contributor

+1

@mambocab
Copy link
Copy Markdown
Contributor Author

mambocab commented Feb 9, 2017

Thanks, merging 👍

@mambocab mambocab merged commit 2f9274a into apache:master Feb 9, 2017
@mambocab mambocab deleted the PYTHON-686 branch February 9, 2017 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants