-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.py
47 lines (40 loc) · 1.43 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
import os
from setuptools import setup, Extension
from Cython.Build import cythonize # pylint: disable=import-error
with open('README.md') as fh:
LONG_DESCRIPTION = fh.read()
def find_all_c_files(given_dir, exclude=[]):
c_file_list = []
for i in os.listdir(given_dir):
if i.find('c') > 0 and exclude.count(i) == 0:
c_file_list.append(os.path.join(given_dir, i))
return c_file_list
def set_up_cython_extension():
extra_include_path = []
extra_include_path.append(os.path.join(os.getcwd()))
# collect library
sourcefiles = ['pygncd.pyx']
sourcefiles.extend(find_all_c_files(os.path.join(os.getcwd(), 'gn'), exclude='readgml.c'))
extensions = [
Extension('pygncd', sourcefiles,
include_dirs=extra_include_path
)
]
return cythonize(extensions)
EXT_MODULE_CLASS = set_up_cython_extension()
setup(
name='pygncd',
version='0.1', # different with C++ lib version
ext_modules=EXT_MODULE_CLASS,
author="zhaofeng-shu33",
install_requires=['networkx'],
author_email="616545598@qq.com",
description="a hierachical community detection algorithm by Girvan Newman",
url="https://github.com/zhaofeng-shu33/Girvan-Newman",
long_description=LONG_DESCRIPTION,
long_description_content_type="text/markdown",
classifiers=[
"Programming Language :: Python :: 3",
],
license="Apache License Version 2.0",
)