-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
53 lines (37 loc) · 1.34 KB
/
setup.py
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
42
43
44
45
46
47
48
49
50
51
52
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
from distutils.extension import Extension
from Cython.Build import cythonize
from polygonintegrals.cythonize_custom import mycythonize
# from Cython.Build import cythonize
import numpy as np
my_modules = mycythonize('polygonintegrals/clipSegmentOnGrid.py')
my_modules += mycythonize('polygonintegrals/integreWithinPolygon.py')
my_modules += mycythonize('polygonintegrals/xorshift.py')
my_modules += mycythonize('polygonintegrals/polygonClipping.py')
#my_modules = cythonize([r"*.pyx"],
#annotate=True,
#extra_compile_args=['/EHsc'])
import numpy as np
# Get the version number.
import runpy
__version_str__ = runpy.run_path("polygonintegrals/version.py")["__version_str__"]
import os
paths=['polygonintegrals/examples']
files_to_copy=[]
for path in paths:
for (dir, _, files) in os.walk(path):
for f in files:
files_to_copy.append(os.path.join(dir[len('polygonintegrals')+1:], f))
print('found %d file to copy'%len(files_to_copy))
libname="polygonintegrals"
setup(
name = libname,
version= __version_str__,
packages= ['polygonintegrals'],
ext_modules = my_modules, # additional source file(s)),
include_dirs=[ np.get_include()],
package_data={'polygonintegrals':files_to_copy}
)