Commit b3f6d175 authored by Stefan Behnel's avatar Stefan Behnel

merge

parents f4ac1fec 367498f1
......@@ -25,6 +25,10 @@ Features added
* The cython-mode.el script for Emacs was updated. Patch by Ivan Andrus.
* An option common_utility_include_dir was added to cythonize() to save
oft-used utility code once in a separate directory rather than as
part of each generated file.
Bugs fixed
----------
......
......@@ -658,6 +658,8 @@ def cythonize(module_list, exclude=[], nthreads=0, aliases=None, quiet=False, fo
if 'include_path' not in options:
options['include_path'] = ['.']
if 'common_utility_include_dir' in options:
if 'cache' in options:
raise NotImplementedError, "common_utility_include_dir does not yet work with caching"
if not os.path.exists(options['common_utility_include_dir']):
os.makedirs(options['common_utility_include_dir'])
c_options = CompilationOptions(**options)
......
......@@ -16,8 +16,17 @@ from Cython.Build.Dependencies import cythonize
from distutils.core import setup
# Test concurrent safety if multiprocessing is available.
# (In particular, TravisCI does not support spawning processes from tests.)
try:
import multiprocessing
multiprocessing.Pool(2)
nthreads = 2
except:
nthreads = 0
setup(
ext_modules = cythonize("*.pyx", common_utility_include_dir='common', nthreads=2),
ext_modules = cythonize("*.pyx", common_utility_include_dir='common', nthreads=nthreads),
)
######## a.pyx ########
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment