-
Notifications
You must be signed in to change notification settings - Fork 3
/
setup.py
52 lines (42 loc) · 1.49 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
import os
import pathlib
import re
import setuptools
os.environ["CC"] = "g++"
directory = pathlib.Path(__file__).parent.resolve()
# version
init_path = directory.joinpath('xswap', '__init__.py')
text = init_path.read_text()
pattern = re.compile(r"^__version__ = ['\"]([^'\"]*)['\"]", re.MULTILINE)
version = pattern.search(text).group(1)
# long_description
readme_path = directory.joinpath('README.md')
long_description = readme_path.read_text()
xswap_cpp_extension = setuptools.Extension(
'xswap._xswap_backend',
sources=['xswap/src/xswap_wrapper.cpp', 'xswap/src/bitset.cpp', 'xswap/src/xswap.cpp', 'xswap/lib/roaring.c'],
extra_compile_args=["-std=c++11"],
)
setuptools.setup(
# Package details
name='xswap',
version=version,
url='https://github.com/greenelab/xswap',
project_urls={
'Documentation': 'https://hetio.github.io/xswap/',
'Source': 'https://github.com/hetio/xswap',
'Tracker': 'https://github.com/hetio/xswap/issues',
'Publication': 'https://greenelab.github.io/xswap-manuscript/',
},
description='Python-wrapped C/C++ library for degree-preserving network randomization',
long_description_content_type='text/markdown',
long_description=long_description,
license='BSD 2-Clause',
# Author details
author='Michael Zietz',
author_email='[email protected]',
# Specify python version
python_requires='>=3.5',
ext_modules=[xswap_cpp_extension],
packages=setuptools.find_packages(),
)