forked from os-autoinst/openqa_review
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
53 lines (48 loc) · 1.89 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 os
from subprocess import check_output
from setuptools import setup
# ref: http://blogs.nopcode.org/brainstorm/2013/05/20/pragmatic-python-versioning-via-setuptools-and-git-tags/
# Fetch version from git tags, and write to version.py.
# Also, when git is not available (PyPi package), use stored version.py.
version_py = os.path.join(os.path.dirname(__file__), 'version.py')
try:
# This will not generate PEP440 compliant version strings for any commit
# that is not on the tag itself. setuptools/dist will give a warning.
# Still, this is good enough for now. A (big) alternative would be
# gh:warner/python-versioneer
version_git = check_output(["git", "describe", "--tags"]).rstrip().decode('ascii')
except:
try:
version_git = open(version_py).read().strip().split('=')[-1].replace('"', '')
except:
version_git = '0.0.0'
version_msg = "# Do not edit this file, pipeline versioning is governed by git tags"
open(version_py, 'w').write(version_msg + os.linesep + "__version__ = '" + str(version_git) + "'\n")
setup(
name="openqa_review_script",
version="{ver}".format(ver=version_git),
install_requires=[
"beautifulsoup4",
"future",
"sortedcontainers",
"humanfriendly",
"requests",
],
author="Oliver kurz",
author_email="[email protected]",
description="review helper script for openQA",
license="MIT",
keywords="openQA webscraping script helper review",
url="https://github.com/okurz/openqa_review",
packages=['openqa_review'],
py_modules=['version'],
long_description=open(os.path.join(os.path.dirname(__file__), 'README.md')).read(),
classifiers=[
"Development Status :: 3 - Alpha",
"Topic :: Utilities",
"License :: OSI Approved :: MIT License",
],
entry_points={
'console_scripts': ['openqa-review=openqa_review.openqa_review:main'],
}
)