-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup.py
60 lines (54 loc) · 1.82 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
import os
import subprocess
from setuptools import setup, find_packages
MAJOR_VERSION = "1"
version_file = os.path.join(os.path.dirname(__file__), "oncall_slackbot/VERSION")
if os.path.exists(version_file):
# Read version from file
with open(version_file, "r", encoding="utf8") as fobj:
version = fobj.read().strip()
else:
# Generate the version and store it in the file
# pylint: disable=subprocess-run-check
result = subprocess.run(
"git rev-list --count HEAD", shell=True, capture_output=True, encoding="utf8"
)
commit_count = result.stdout.strip()
version = f"{MAJOR_VERSION}.{commit_count}"
print(f"Setting version to {version} and writing to {version_file}")
with open(version_file, "w", encoding="utf8") as fobj:
fobj.write(version)
install_requires = (
'pygerduty>=0.38.2',
'pytz>=2019.3',
'humanize>=3.14.0',
'spacy<3',
'slack-sdk>=3.15.1',
) # yapf: disable
excludes = (
'*test*',
'*local_settings*',
) # yapf: disable
setup(
name="oncall-slackbot",
version=version,
license="MIT",
description="Slackbot made specifically to handle on-call requests",
author="Brian Saville",
author_email="bksaville@gmail.com",
url="http://github.com/bluesliverx/oncall-slackbot",
platforms=["Any"],
packages=find_packages(exclude=excludes),
install_requires=install_requires,
classifiers=[
"Development Status :: 4 - Beta",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
],
)