mirror of https://github.com/explosion/spaCy.git
* Add monkey-patch to fix pypy compilation
This commit is contained in:
parent
e3af8dcb9d
commit
def7e98bd3
15
setup.py
15
setup.py
|
@ -10,6 +10,20 @@ from os.path import splitext
|
||||||
|
|
||||||
|
|
||||||
from setuptools import Extension
|
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):
|
def clean(ext):
|
||||||
|
@ -45,7 +59,6 @@ def cython_ext(mod_name, language, includes, compile_args):
|
||||||
|
|
||||||
|
|
||||||
def run_setup(exts):
|
def run_setup(exts):
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='spacy',
|
name='spacy',
|
||||||
packages=['spacy', 'spacy.en', 'spacy.syntax'],
|
packages=['spacy', 'spacy.en', 'spacy.syntax'],
|
||||||
|
|
Loading…
Reference in New Issue