-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
35 lines (31 loc) · 1010 Bytes
/
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
import re
from pathlib import Path
from setuptools import find_packages, setup
with open(Path(__file__).parent / "kuroutils" / "__init__.py", "r") as fp:
version = re.search(r"__version__ = \"(\d*\.\d*\.\d*)\"", fp.read()).group(1)
try:
import subprocess
process = subprocess.Popen(
["git", "rev-parse", "--short", "HEAD"], stdout=subprocess.PIPE, stderr=subprocess.PIPE
)
out, err = process.communicate()
if out:
version += "+g" + out.decode("utf-8").strip()[:7]
except Exception:
pass
with open("README.md", "r") as fp:
long_description = fp.read()
with open("requirements.txt") as fp:
install_requires = fp.read().splitlines()
setup(
name="Kuro-Utils",
version=version,
description="Utils for Kuro-Cogs.",
long_description=long_description,
author="Kuro-Rui",
url="/~https://github.com/Kuro-Rui/Kuro-Utils",
packages=find_packages(),
license="MIT",
python_requires=">=3.8.1",
install_requires=install_requires,
)