-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
65 lines (50 loc) · 1.48 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
import os
import platform
from Cython.Build import cythonize
from setuptools import Extension
from setuptools import find_packages
from setuptools import setup
LIBRARY = "tarchia"
__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"
def is_win(): # pragma: no cover
os.name == "nt"
if is_mac():
COMPILE_FLAGS = ["-O3"]
elif is_win():
COMPILE_FLAGS = ["/O2"]
else:
COMPILE_FLAGS = ["-O3", "-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("tarchia.egg-info/requires.txt", "r") as f:
required = f.read().splitlines()
extensions = []
setup_config = {
"name": LIBRARY,
"version": __version__,
"description": "Tarchia - Metadata Catalog",
"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)