-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathsetup.py
More file actions
53 lines (45 loc) · 1.17 KB
/
setup.py
File metadata and controls
53 lines (45 loc) · 1.17 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
42
43
44
45
46
47
48
49
50
51
52
53
from glob import glob
from setuptools import setup, Extension
try:
from Cython.Build import cythonize
except ImportError:
USE_CYTHON = False
else:
USE_CYTHON = True
ext = ".pyx" if USE_CYTHON else ".c"
classic_sourcefiles = [
"planarity/classic/planarity" + ext,
]
classic_sourcefiles.extend(glob("planarity/c/graphLib/**/*.c", recursive=True))
graphLib_sourcefiles = [
"planarity/full/graphLib" + ext,
]
graphLib_sourcefiles.extend(
glob("planarity/c/graphLib/**/*.c", recursive=True)
)
extensions = [
Extension(
name="planarity.classic.planarity",
sources=classic_sourcefiles,
include_dirs=['planarity/c/graphLib'],
),
Extension(
name="planarity.full.graphLib",
sources=graphLib_sourcefiles,
include_dirs=["planarity/c/graphLib"],
),
Extension(
name="planarity.full.g6IterationUtils",
sources=[f"planarity/full/g6IterationUtils{ext}"],
),
Extension(
name="planarity.full.graph",
sources=[f"planarity/full/graph{ext}"],
),
]
if USE_CYTHON:
from Cython.Build import cythonize
extensions = cythonize(extensions)
setup(
ext_modules = extensions,
)