-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup.py
63 lines (51 loc) · 1.67 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
import os
import sys
from setuptools import setup
from setuptools import find_packages
from setuptools.command.install import install
__version__ = "1.1.24"
with open("README.md", "r") as fh:
long_description = fh.read()
def get_requirements(filename):
with open(filename, "r", encoding="utf-8") as fp:
reqs = [x.strip() for x in fp.read().splitlines()
if not x.strip().startswith('#') and not x.strip().startswith('-i')]
return reqs
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('CI_COMMIT_TAG')
if tag != f"v{__version__}":
info = "Git tag: {0} does not match the version of this app: {1}".format(
tag, __version__
)
sys.exit(info)
setup(
name="streamingcli",
version=__version__,
author="GetInData",
description="Streaming platform CLI",
long_description=long_description,
url="https://gitlab.com/getindata/streaming-labs/streaming-cli",
packages=find_packages(),
python_requires='>=3.9',
classifiers=[
"Programming Language :: Python :: 3.9",
"Operating System :: OS Independent",
],
install_requires=get_requirements('requirements.txt'),
py_modules=['streamingcli'],
entry_points={
'console_scripts': [
'scli = streamingcli.main:cli',
],
},
package_data={
'streamingcli.project': ['templates/*'],
},
cmdclass={
'verify': VerifyVersionCommand,
}
)