From bf05e555d2b36ce0338dce69ea403f8ba30b669a Mon Sep 17 00:00:00 2001 From: Jason Paryani Date: Mon, 2 Mar 2015 13:44:12 -0800 Subject: [PATCH] Default to using cython if cythonized files not found --- setup.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/setup.py b/setup.py index 3a467c6..890e48f 100644 --- a/setup.py +++ b/setup.py @@ -3,12 +3,6 @@ from __future__ import print_function use_cython = False -import pkg_resources -setuptools_version = pkg_resources.get_distribution("setuptools").version -if setuptools_version < '0.8': - # older versions of setuptools don't work with cython - use_cython = False - from distutils.core import setup import os import sys @@ -66,6 +60,11 @@ class clean(_clean): except OSError: pass +# set use_cython if lib/capnp.cpp is not detected +capnp_compiled_file = os.path.join(os.path.dirname(__file__), 'capnp', 'lib', 'capnp.cpp') +if not os.path.isfile(capnp_compiled_file): + use_cython = True + # hack to parse commandline arguments force_bundled_libcapnp = "--force-bundled-libcapnp" in sys.argv if force_bundled_libcapnp: