-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
49 lines (37 loc) · 1.04 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
#!/usr/bin/env python
"""
Setup script for ais_tools
"""
from setuptools import find_packages
from setuptools import setup
import codecs
import sys
import os
from setuptools import Extension
# package = __import__('ais_tools')
extra_compile_args = []
extra_link_args = []
undef_macros = []
if sys.platform == "win32":
extra_compile_args += []
else:
extra_compile_args += ["-std=c11", "-Wall", "-Werror", "-O3"]
source_path = 'ais_tools/core/'
sources = [f'{source_path}{file}' for file in os.listdir(source_path) if file.endswith('.c')]
core_module = Extension(
"ais_tools.core",
extra_compile_args=extra_compile_args,
extra_link_args=extra_link_args,
sources=sources,
include_dirs=[source_path],
undef_macros=undef_macros,
)
with codecs.open('requirements.txt', encoding='utf-8') as f:
DEPENDENCY_LINKS = [line for line in f]
setup(
include_package_data=True,
packages=find_packages(exclude=['test*.*', 'tests']),
zip_safe=True,
dependency_links=DEPENDENCY_LINKS,
ext_modules=[core_module],
)