forked from CraftSpider/dpytest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
53 lines (47 loc) · 1.85 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
import setuptools
import re
with open("discord/ext/test/__init__.py", "r") as file:
try:
version = re.search(r"^__version__\s*=\s*[\"']([^\"']*)[\"']", file.read(), re.MULTILINE).group(1)
except Exception as e:
raise RuntimeError("Version isn't set")
if version.endswith(("a", "b")):
try:
import subprocess as sp
p = sp.Popen(["git", "rev-list", "--count", "HEAD"], stdout=sp.PIPE, stderr=sp.PIPE)
out, err = p.communicate()
if out:
version += out.decode("utf-8").strip()
p = sp.Popen(["git", "rev-parse", "--short", "HEAD"], stdout=sp.PIPE, stderr=sp.PIPE)
out, err = p.communicate()
if out:
version += "+g" + out.decode("utf-8").strip()
except Exception as e:
raise RuntimeError("Failure to get current git commit")
with open("README.md", "r") as readme_file:
readme = readme_file.read()
with open('HISTORY.md', "r") as history_file:
history = history_file.read()
setuptools.setup(
name="dpytest",
version=version,
author="Rune Tynan",
author_email="[email protected]",
description="A package that assists in writing tests for discord.py",
long_description=readme + '\n\n' + history,
long_description_content_type="text/markdown",
url="https://github.com/CraftSpider/dpytest",
packages=["discord.ext.test"],
classifiers=[
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Development Status :: 3 - Alpha",
"Topic :: Software Development :: Testing"
],
keywords="discord discord.py test",
install_requires=["discord.py", "pytest-asyncio"]
)