-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsetup.py
More file actions
72 lines (60 loc) · 1.94 KB
/
setup.py
File metadata and controls
72 lines (60 loc) · 1.94 KB
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
import platform
import numpy
from Cython.Build import cythonize
from setuptools import Extension
from setuptools import find_packages
from setuptools import setup
LIBRARY = "orso"
def is_mac(): # pragma: no cover
return platform.system().lower() == "darwin"
COMPILE_FLAGS = ["-O2"] if is_mac() else ["-O2", "-march=native"]
__version__ = "notset"
with open(f"{LIBRARY}/version.py", mode="r") as v:
vers = v.read()
exec(vers) # nosec
with open("README.md", mode="r", encoding="UTF8") as rm:
long_description = rm.read()
try:
with open("requirements.txt", "r") as f:
required = f.read().splitlines()
except:
with open(f"{LIBRARY}.egg-info/requires.txt", "r") as f:
required = f.read().splitlines()
extensions = [
# Cython code
Extension(
name="orso.compute.compiled",
sources=["orso/compute/compiled.pyx"],
include_dirs=[numpy.get_include()],
extra_compile_args=COMPILE_FLAGS,
extra_link_args=COMPILE_FLAGS,
),
Extension(
name="orso.compute.column_encodings",
sources=["orso/compute/column_encodings.pyx"],
include_dirs=[numpy.get_include(), "orso/compute"],
extra_compile_args=COMPILE_FLAGS,
extra_link_args=COMPILE_FLAGS,
language="c++",
),
]
setup_config = {
"name": LIBRARY,
"version": __version__,
"description": "🐻 DataFrame Library",
"long_description": long_description,
"long_description_content_type": "text/markdown",
"author_email": "justin.joyce@joocer.com",
"packages": find_packages(include=[LIBRARY, f"{LIBRARY}.*"]),
"url": "https://github.com/mabel-dev/orso/",
"ext_modules": cythonize(extensions),
"install_requires": required,
"extras_require": {
# pysimdjson provides the `simdjson` Python module used as an optional accelerator.
"simdjson": ["pysimdjson"],
},
"package_data": {
"": ["*.pyx", "*.pxd"],
},
}
setup(**setup_config)