From def7e98bd352ec1e31d5679ccde88789307cdb4f Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Tue, 6 Jan 2015 12:34:55 +1100 Subject: [PATCH] * Add monkey-patch to fix pypy compilation --- setup.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index ac3b744ed..cbdab390e 100644 --- a/setup.py +++ b/setup.py @@ -10,6 +10,20 @@ from os.path import splitext from setuptools import Extension +from distutils import sysconfig +import platform + +# We have to resort to monkey-patching to set the compiler, because pypy broke +# ALL the EVERTHING. + +orig_customize_compiler = sysconfig.customize_compiler +def my_customize_compiler(compiler): + orig_customize_compiler(compiler) + compiler.compiler_cxx = ['c++'] + + +if platform.python_implementation() == 'PyPy': + sysconfig.customize_compiler = my_customize_compiler def clean(ext): @@ -45,7 +59,6 @@ def cython_ext(mod_name, language, includes, compile_args): def run_setup(exts): - setup( name='spacy', packages=['spacy', 'spacy.en', 'spacy.syntax'],