From 73674a4afb7ed71a2dd03b3ba26925b67877cc7f Mon Sep 17 00:00:00 2001 From: Henning Peters Date: Sun, 13 Dec 2015 12:51:23 +0100 Subject: [PATCH] try using system-wide headers --- bin/cythonize.sh | 7 ------- build.sh | 7 +++++++ setup.py | 23 ++++++++++++----------- 3 files changed, 19 insertions(+), 18 deletions(-) delete mode 100755 bin/cythonize.sh create mode 100755 build.sh diff --git a/bin/cythonize.sh b/bin/cythonize.sh deleted file mode 100755 index d78f7b5fc..000000000 --- a/bin/cythonize.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -if [ ! -d ".cythonize" ]; then - virtualenv .cythonize -fi -. .cythonize/bin/activate -pip install -U -r requirements.txt -./bin/cythonize.py $@ diff --git a/build.sh b/build.sh new file mode 100755 index 000000000..495561031 --- /dev/null +++ b/build.sh @@ -0,0 +1,7 @@ +#!/bin/bash +if [ ! -d ".build" ]; then + virtualenv --always-copy .build +fi +. .build/bin/activate +pip install -U -r requirements.txt +tox $@ diff --git a/setup.py b/setup.py index 8211738d5..d5f0b82a9 100644 --- a/setup.py +++ b/setup.py @@ -172,7 +172,8 @@ if not release: def generate_cython(): cwd = os.path.abspath(os.path.dirname(__file__)) print('Cythonizing sources') - p = subprocess.call([os.path.join(cwd, 'bin', 'cythonize.sh'), + p = subprocess.call([sys.executable, + os.path.join(cwd, 'bin', 'cythonize.py'), 'spacy'], cwd=cwd) if p != 0: @@ -197,8 +198,8 @@ def setup_package(): write_version_py() include_dirs = [ - os.path.join(sys.prefix, 'include'), - get_python_inc(plat_specific=True)] + get_python_inc(plat_specific=True), + os.path.join(src_path, 'include')] ext_modules = [] for mod_name in MOD_NAMES: @@ -236,15 +237,15 @@ def setup_package(): shutil.rmtree(include_dir) os.mkdir(include_dir) - # import numpy - # shutil.copytree( - # os.path.join(numpy.get_include(), 'numpy'), - # os.path.join(include_dir, 'numpy')) + import numpy + shutil.copytree( + os.path.join(numpy.get_include(), 'numpy'), + os.path.join(include_dir, 'numpy')) - # import murmurhash - # shutil.copytree( - # os.path.join(os.path.dirname(murmurhash.__file__), 'headers', 'murmurhash'), - # os.path.join(include_dir, 'murmurhash')) + import murmurhash + shutil.copytree( + os.path.join(os.path.dirname(murmurhash.__file__), 'headers', 'murmurhash'), + os.path.join(include_dir, 'murmurhash')) try: setup(**metadata)