forked from DeDolphins/DataHorse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
86 lines (77 loc) · 2.3 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
84
85
86
import os
import re
import setuptools
from typing import AnyStr, List
def read_file(path_parts: List[str], encoding: str = "utf-8") -> AnyStr:
"""
Read a file from the project directory
Args:
path_parts: List of parts of the path to the file
encoding: Encoding of the file
Returns:
Content of the file as a string
"""
with open(
os.path.join(os.path.dirname(__file__), *path_parts), "r", encoding=encoding
) as file:
return file.read()
version_contents = read_file(["datahorse", "__version__.py"])
about = {}
for key in [
"__author__",
"__author_email__",
"__description__",
"__license__",
"__title__",
"__url__",
"__version__",
]:
key_match = re.search(f"{key} = ['\"]([^'\"]+)['\"]", version_contents)
if key_match:
about[key] = key_match.group(1)
readme = read_file(["README.md"])
# Include only pandas and groq
required_packages = [
"pandas",
"groq",
]
extras = {
"test": [
"black",
"coverage",
"flake8",
"mock",
"pydocstyle",
"pytest",
"pytest-cov",
"tox",
]
}
setuptools.setup(
name=about.get("__title__", "unknown"),
version=about.get("__version__", "0.0.0"),
description=about.get("__description__", "unknown"),
long_description=readme,
author=about.get("__author__", "unknown"),
author_email=about.get("__author_email__", "unknown"),
url=about.get("__url__", "unknown"),
packages=setuptools.find_packages("datahorse"),
classifiers=[
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Natural Language :: English",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
],
license=about.get("__license__", "unknown"),
package_dir={"": "datahorse"},
package_data={"": ["*.txt"]},
extras_require=extras,
install_requires=required_packages,
long_description_content_type="text/markdown",
python_requires=">=3.7.0",
)