-
Notifications
You must be signed in to change notification settings - Fork 94
/
Copy pathsetup.py
executable file
·85 lines (70 loc) · 2.24 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/usr/bin/env python3
import os
import re
import sys
from setuptools import setup, find_packages
from setuptools.command.install import install
ROOT = os.path.dirname(__file__)
VERSION_RE = re.compile(r"""__version__ = ['"]([0-9.]+)['"]""")
requires = [
"boto3",
"ipaddress",
"diagrams>=0.13",
"jinja2<3.0",
"cachetools",
"diskcache",
"pytz",
]
def get_version():
init = open(os.path.join(ROOT, "cloudiscovery", "__init__.py")).read()
return VERSION_RE.search(init).group(1)
class VerifyVersionCommand(install):
"""Custom command to verify that the git tag matches our version"""
description = "verify that the git tag matches our version"
def run(self):
tag = os.getenv("CIRCLE_TAG")
if tag != get_version():
info = "Git tag: {0} does not match the version of this app: {1}".format(
tag, get_version()
)
sys.exit(info)
setup(
name="cloudiscovery",
version=get_version(),
description="The tool to help you discover resources in the cloud environment",
long_description="Long description",
author="Cloud Architects",
url="https://github.com/Cloud-Architects/cloudiscovery",
package_data={
"": [
"locales/en_US/LC_MESSAGES/messages.mo",
"locales/pt_BR/LC_MESSAGES/messages.mo",
"templates/report_html.html",
"templates/report_limits.html",
]
},
packages=find_packages(exclude=["tests*"]),
install_requires=requires,
setup_requires=["pytest-runner"],
tests_require=[
"pytest",
"pytest-cov",
"pytest-xdist",
"assertpy",
"pytest-pythonpath",
],
tests_suite="cloudiscovery",
python_requires=">=3.8",
scripts=["bin/cloudiscovery", "bin/cloudiscovery.cmd"],
license="Apache License 2.0",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: System Administrators",
"Natural Language :: English",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python",
"Programming Language :: Python :: 3.8",
],
cmdclass={"verify": VerifyVersionCommand},
)