aboutsummaryrefslogtreecommitdiffhomepage
path: root/setup.py
diff options
context:
space:
mode:
authorGravatar Yuchen Zeng <zyc@google.com>2017-01-18 18:49:07 -0800
committerGravatar Yuchen Zeng <zyc@google.com>2017-01-18 18:49:07 -0800
commit04ec4701e303b8b41d90d5ce6861689c7f0fab7f (patch)
treeb37a55fead11bb07956718671aa1b1ed1bbb3991 /setup.py
parentb0023d25dc783ba77164c03a39bb7dcc7e446fe8 (diff)
parent6da1dc87aa3384594e9ab6218b1e0886573108de (diff)
Merge remote-tracking branch 'upstream/master' into cares_buildin
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py21
1 files changed, 12 insertions, 9 deletions
diff --git a/setup.py b/setup.py
index 69bd4331ba..db3d7b1024 100644
--- a/setup.py
+++ b/setup.py
@@ -227,15 +227,18 @@ SETUP_REQUIRES = INSTALL_REQUIRES + (
'six>=1.10',
) if ENABLE_DOCUMENTATION_BUILD else ()
-if BUILD_WITH_CYTHON:
- sys.stderr.write(
- "You requested a Cython build via GRPC_PYTHON_BUILD_WITH_CYTHON, "
- "but do not have Cython installed. We won't stop you from using "
- "other commands, but the extension files will fail to build.\n")
-elif need_cython:
- sys.stderr.write(
- 'We could not find Cython. Setup may take 10-20 minutes.\n')
- SETUP_REQUIRES += ('cython>=0.23',)
+try:
+ import Cython
+except ImportError:
+ if BUILD_WITH_CYTHON:
+ sys.stderr.write(
+ "You requested a Cython build via GRPC_PYTHON_BUILD_WITH_CYTHON, "
+ "but do not have Cython installed. We won't stop you from using "
+ "other commands, but the extension files will fail to build.\n")
+ elif need_cython:
+ sys.stderr.write(
+ 'We could not find Cython. Setup may take 10-20 minutes.\n')
+ SETUP_REQUIRES += ('cython>=0.23',)
COMMAND_CLASS = {
'doc': commands.SphinxDocumentation,