Commit 5c7abd5d authored by Stefan Behnel's avatar Stefan Behnel

Make the setup.py script importable to enable multiprocessing builds that need...

Make the setup.py script importable to enable multiprocessing builds that need to "spawn" processes (usually on Windows).
parent 4478f22f
...@@ -188,15 +188,10 @@ try: ...@@ -188,15 +188,10 @@ try:
except ValueError: except ValueError:
compile_cython_itself = True compile_cython_itself = True
if compile_cython_itself and (is_cpython or cython_compile_more):
compile_cython_modules(cython_profile, cython_compile_more, cython_with_refnanny)
setup_args.update(setuptools_extra_args) setup_args.update(setuptools_extra_args)
from Cython import __version__ as version
def dev_status(version):
def dev_status():
if 'b' in version or 'c' in version: if 'b' in version or 'c' in version:
# 1b1, 1beta1, 2rc1, ... # 1b1, 1beta1, 2rc1, ...
return 'Development Status :: 4 - Beta' return 'Development Status :: 4 - Beta'
...@@ -224,7 +219,13 @@ packages = [ ...@@ -224,7 +219,13 @@ packages = [
'pyximport', 'pyximport',
] ]
setup(
def run_build():
if compile_cython_itself and (is_cpython or cython_compile_more):
compile_cython_modules(cython_profile, cython_compile_more, cython_with_refnanny)
from Cython import __version__ as version
setup(
name='Cython', name='Cython',
version=version, version=version,
url='https://cython.org/', url='https://cython.org/',
...@@ -257,7 +258,7 @@ setup( ...@@ -257,7 +258,7 @@ setup(
"""), """),
license='Apache', license='Apache',
classifiers=[ classifiers=[
dev_status(), dev_status(version),
"Intended Audience :: Developers", "Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License", "License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent", "Operating System :: OS Independent",
...@@ -283,4 +284,8 @@ setup( ...@@ -283,4 +284,8 @@ setup(
packages=packages, packages=packages,
py_modules=["cython"], py_modules=["cython"],
**setup_args **setup_args
) )
if __name__ == '__main__':
run_build()
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