-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
45 lines (37 loc) · 1.06 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
import os
from setuptools import setup, Extension, find_packages
import numpy
try:
from Cython.Build import cythonize
USE_CYTHON = True
except ImportError:
USE_CYTHON = False
__NAME__ = "csgraph_mod"
__VERSION__ = "0.0.2"
__AUTHOR__ = "Nikolaos Papadopoulos, Johannes Soeding"
__AUTHOR_EMAIL__ = "[email protected]"
__DESCRIPTION__ = "Modified Dijkstra algorithm from the shortest_path.pyx collection of SciPy"
__LICENSE__ = "BSD"
ext = ".pyx" if USE_CYTHON else ".c"
module_names = [
"csgraph_mod.shortest_path_mod"
]
extensions = []
for module_name in module_names:
file_name = module_name.replace(".", os.sep) + ext
extension = Extension(module_name, [file_name])
extensions.append(extension)
if USE_CYTHON:
extensions = cythonize(extensions)
setup(
name=__NAME__,
version=__VERSION__,
author=__AUTHOR__,
author_email=__AUTHOR_EMAIL__,
description=__DESCRIPTION__,
license=__LICENSE__,
ext_modules=extensions,
packages=find_packages(),
include_dirs=[numpy.get_include()],
test_suite="nose.collector"
)