-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
70 lines (63 loc) · 2.28 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import os
import platform
from setuptools import setup
from setuptools.extension import Extension
from Cython.Build import cythonize
import versioneer
with open("README.md", "r") as fh:
long_description = fh.read()
if platform.system() == "Windows":
compile_extra_args = []
link_extra_args = []
elif platform.system() == "Linux":
compile_extra_args = ["-O3"]
link_extra_args = ["-O3"]
elif platform.system() == "Darwin":
compile_extra_args = ["-O3", "-std=c++11", "-mmacosx-version-min=10.9"]
link_extra_args = ["-O3", "-stdlib=libc++", "-mmacosx-version-min=10.9"]
extensions = [
Extension('sib.c_package.c_sib_optimizer', # name/path of generated .so file
['src/sib/c_package/c_sib_optimizer.pyx'], # cython file
extra_compile_args=compile_extra_args,
extra_link_args=link_extra_args,
language="c++")
]
# collecting all dependencies from requirements.txt
current_dir = os.path.dirname(os.path.realpath(__file__))
requirements_file = os.path.join(current_dir, 'requirements.txt')
install_requires = []
if os.path.isfile(requirements_file):
with open(requirements_file) as f:
install_requires = f.read().splitlines()
else:
raise Exception('error: unable to locate requirements.txt')
setup(
name="sib-clustering",
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
author="Assaf Toledo",
author_email="assaf.toledo@ibm.com",
description="sequential Information Bottleneck",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/IBM/sib",
include_package_data=True,
packages=['sib',
'sib.c_package',
],
package_dir={'': 'src'},
ext_modules = cythonize(extensions),
classifiers=[
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Operating System :: Unix',
'Operating System :: POSIX',
'Operating System :: Microsoft :: Windows',
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
],
install_requires=install_requires,
python_requires='>=3.6',
)