-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup.py
74 lines (61 loc) · 1.92 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
import os
import sys
from typing import List
from setuptools import find_packages, setup
from setuptools.command.install import install
__version__ = "1.3.2"
with open("README.md", "r") as fh:
long_description = fh.read()
def get_requirements(filename: str) -> List[str]:
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) -> None:
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)
EXTRAS_REQUIRE = {
"tests": [
"pytest>=6.2.2, <7.0.0",
"pytest-cov>=2.8.0, <3.0.0",
"pre-commit==2.15.0",
"tox==3.21.1",
]
}
setup(
name="streamingcli",
version=__version__,
author="GetInData",
description="Streaming platform CLI",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/getindata/streaming-cli",
packages=find_packages(),
python_requires='>=3.8',
classifiers=[
"Programming Language :: Python :: 3.8",
"Operating System :: OS Independent",
],
install_requires=get_requirements('requirements.txt'),
extras_require=EXTRAS_REQUIRE,
py_modules=['streamingcli'],
entry_points={
'console_scripts': [
'scli = streamingcli.main:cli',
],
},
package_data={
'streamingcli.project': ['templates/*'],
},
cmdclass={
'verify': VerifyVersionCommand,
}
)