-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.py
48 lines (35 loc) · 1.17 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
import glob
import os
from setuptools import find_packages, setup
__version__: str | None = None
with open("ub_core/version.py", mode="r", encoding="utf-8") as version_file:
exec(version_file.read())
def get_platform_requirements() -> list[str]:
with open("requirements.txt", mode="r", encoding="utf-8") as req_file:
packages: list[str] = req_file.readlines()
if "termux" not in os.environ.get("HOME", ""):
return packages
return [
package
for package in packages
if package.split(">")[0] not in ("uvloop", "psutil", "pillow")
]
def clean_up():
cache = [item for item in ("./build", "./*egg-info", "./dist") if glob.glob(item)]
os.system(" ".join(["rm -r", *cache]))
setup(
name="ub_core",
version=__version__,
author="Meliodas",
description="BoilerPlate Code for Bot projects.",
packages=find_packages(),
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
python_requires="~=3.11",
install_requires=get_platform_requirements(),
scripts=["bin/run-ub-core"],
)
clean_up()