-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
98 lines (72 loc) · 2.52 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
87
88
89
90
91
92
93
94
95
96
97
98
#!/usr/bin/env python3
import sys
from os import path
from setuptools import find_packages, setup
try:
from semantic_release import setup_hook
setup_hook(sys.argv)
except ImportError:
pass
cwd = path.abspath(path.dirname(__file__))
def build_description():
with open("README.md", "r") as fh:
long_description = fh.read()
return long_description
def metadata():
meta = {}
with open(path.join(cwd, "yc_lockbox", "__init__.py"), "r") as fh:
exec(fh.read(), meta) # nosec
return meta
def get_requirements(req_file: str | list[str] = "requirements.txt"):
requirements_list = []
def collect_requirements(f: str):
nonlocal requirements_list
with open(f) as requirements:
for install in requirements:
requirements_list.append(install.strip())
if isinstance(req_file, list):
for req in req_file:
collect_requirements(req)
else:
collect_requirements(req_file)
return requirements_list
def aio_requirements():
return get_requirements("requirements.aio.txt")
meta = metadata()
def main() -> None:
setup(
name="yc-lockbox",
keywords=["yandex", "cloud", "vault", "secrets", "lockbox"],
platforms=["osx", "linux"],
entry_points={},
version=meta.get("__version__"),
author=meta.get("__author__"),
author_email=meta.get("__author_email__"),
license=meta.get("__license__"),
description="Yandex Lockbox client",
long_description=build_description(),
long_description_content_type="text/markdown",
url=meta.get("__url__"),
python_requires=">=3.10",
packages=find_packages(),
install_requires=get_requirements(),
extras_require={
"aio": aio_requirements(),
},
classifiers=[
"License :: OSI Approved :: MIT License",
"Intended Audience :: Information Technology",
"Intended Audience :: System Administrators",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Typing :: Typed",
],
)
if __name__ == "__main__":
main()