-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
83 lines (70 loc) · 2.11 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
71
72
73
74
75
76
77
78
79
80
81
82
83
import platform
from Cython.Build import cythonize
from setuptools import Extension
from setuptools import find_packages
from setuptools import setup
LIBRARY = "draken"
__author__ = "notset"
__version__ = "0.0.0"
with open(f"{LIBRARY}/__version__.py", mode="r") as v:
vers = v.read()
# xec(vers) # nosec
def is_mac(): # pragma: no cover
return platform.system().lower() == "darwin"
if is_mac():
COMPILE_FLAGS = ["-O2"]
else:
COMPILE_FLAGS = ["-O2", "-march=native"]
with open("README.md", "r") as rm:
long_description = rm.read()
try:
with open("requirements.txt", "r") as f:
required = f.read().splitlines()
except:
with open("draken.egg-info/requires.txt", "r") as f:
required = f.read().splitlines()
extensions = [
Extension(
name="draken.compiled.murmurhash3_32",
sources=["draken/compiled/murmurhash3_32.pyx"],
language="c++",
extra_compile_args=COMPILE_FLAGS,
),
Extension(
name="draken.compiled.bloom_filter",
sources=["draken/compiled/bloom_filter.pyx"],
language="c++",
extra_compile_args=COMPILE_FLAGS,
),
Extension(
name="draken.compiled.sstable",
sources=["draken/compiled/sstable.pyx"],
extra_compile_args=COMPILE_FLAGS,
include_dirs=["."],
),
Extension(
name="draken.compiled.accumulation_tree",
sources=["draken/compiled/accumulation_tree.pyx"],
extra_compile_args=COMPILE_FLAGS,
include_dirs=["."],
),
]
setup_config = {
"name": LIBRARY,
"version": __version__,
"description": "Draken - External Indexes",
"long_description": long_description,
"long_description_content_type": "text/markdown",
"maintainer": "@joocer",
"author": __author__,
"author_email": "[email protected]",
"packages": find_packages(include=[LIBRARY, f"{LIBRARY}.*"]),
"python_requires": ">=3.9",
"url": "https://github.com/mabel-dev/{LIBRARY}/",
"install_requires": required,
"ext_modules": cythonize(extensions),
"package_data": {
"": ["*.pyx", "*.pxd"],
},
}
setup(**setup_config)