From 34329a0d2c6e2da2cb1848901ce4217b8fc69b21 Mon Sep 17 00:00:00 2001 From: Qingping Hou Date: Sat, 10 Oct 2020 22:54:17 -0700 Subject: [PATCH] fix cython build Due to a bug in cython, cythonize actually doesn't support include_dirs override: https://github.com/cython/cython/issues/1480 --- setup.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index a31380f0..0127e84d 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ import subprocess import sys import numpy -from setuptools import setup, find_packages +from setuptools import setup, find_packages, Extension import setuptools.command.develop import setuptools.command.build_py @@ -60,6 +60,13 @@ def find_pyx(path='.'): return pyx_files +def find_cython_extensions(path="."): + exts = cythonize(find_pyx(path), language_level=3) + for ext in exts: + ext.include_dirs = [numpy.get_include()] + return exts + + class build_py(setuptools.command.build_py.build_py): # pylint: disable=too-many-ancestors def run(self): self.create_version_file() @@ -113,8 +120,7 @@ setup( description='Text to Speech with Deep Learning', license='MPL-2.0', entry_points={'console_scripts': ['tts-server = TTS.server.server:main']}, - include_dirs=[numpy.get_include()], - ext_modules=cythonize(find_pyx(), language_level=3), + ext_modules=find_cython_extensions(), packages=find_packages(include=['TTS*']), project_urls={ 'Documentation': 'https://github.com/mozilla/TTS/wiki',