forked from ionelmc/python-hunter
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
41 lines (37 loc) · 1.14 KB
/
setup.py
File metadata and controls
41 lines (37 loc) · 1.14 KB
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
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
import os
import sys
from glob import glob
from os.path import dirname
from os.path import join
from os.path import relpath
from os.path import splitext
from setuptools import Extension
from setuptools import setup
try:
# Allow installing package without any Cython available. This
# assumes you are going to include the .c files in your sdist.
import Cython
except ImportError:
Cython = None
if __name__ == '__main__':
setup(
package_dir={'': 'tests'},
zip_safe=False,
setup_requires=[
'cython',
] if Cython else [],
ext_modules=[] if hasattr(sys, 'pypy_version_info') else [
Extension(
splitext(relpath(path, 'tests').replace(os.sep, '.'))[0],
sources=[path],
include_dirs=[dirname(path), 'src'],
define_macros=[('CYTHON_TRACE', '1')]
)
for root, _, _ in os.walk('tests')
for path in glob(join(root, '*.pyx' if Cython else '*.c'))
] ,
)