forked from msabramo/cython-test
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
30 lines (25 loc) · 759 Bytes
/
Copy pathsetup.py
File metadata and controls
30 lines (25 loc) · 759 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import sys
try:
from setuptools import setup
from setuptools.extension import Extension
except ImportError:
print("Couldn't import setuptools. Falling back to distutils.")
from distutils.core import setup
#
# Force `setup_requires` stuff like Cython to be installed before proceeding
#
from setuptools.dist import Distribution
Distribution(dict(setup_requires='Cython'))
try:
from Cython.Distutils import build_ext
except ImportError:
print("Could not import Cython.Distutils. Install `cython` and rerun.")
sys.exit(1)
ext_modules = [Extension("hello", ["hello.pyx"])]
setup(
name = 'Hello world app',
cmdclass = {'build_ext': build_ext},
ext_modules = ext_modules,
setup_requires = ['Cython'],
test_suite='test',
)