/
setup.py
141 lines (117 loc) · 3.38 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
"""
used to create pypi package to make the nephos module pip installable
"""
import subprocess
import platform
import sys
from os import path
from setuptools import setup
# =============================================
# version information
VERSION = (0, 0, 1)
VERSION_SUFFIX = 'under.dev'
VERSION_STRING = ".".join(str(x) for x in VERSION)
RELEASE_STRING = VERSION_STRING + " " + VERSION_SUFFIX
# make changes above when deploying new version
# =============================================
__title__ = "Nephos"
__description__ = "Nephos - Capture streams, process them and upload to cloud storage"
__author__ = "Shivam Kumar Jha (github@thealphadollar)"
__author_mail__ = "shivam.cs.iit.kgp+Nephos@gmail.com" # TODO: Update author's mail address
__license__ = "GNU GPL v3"
__version__ = VERSION_STRING
__release__ = RELEASE_STRING
def update_version():
"""
Rewrites version information to `/nephos/ver_info.py` on every new deployment.
Returns
-------
"""
info = '''# -*- coding: utf-8 -*-
"""
Stores basic version information about the project
"""
# =====================================
# THIS FILE WAS GENERATED AUTOMATICALLY
# =====================================
#
VER_INFO = """
__title__ = 'Nephos'
__description__ = 'Nephos - Capture streams, process them and upload to cloud storage'
__author__ = 'Shivam Kumar Jha (github@thealphadollar)'
__author_mail__ = 'shivam.cs.iit.kgp+Nephos@gmail.com'
__license__ = 'GNU GPL v3'
__version__ = '0.0.1'
__release__ = '0.0.1 under.dev'"""
'''.format(
title=__title__,
description=__description__,
author=__author__,
author_mail=__author_mail__,
license=__license__,
version=__version__,
release=__release__,
)
outfile = path.join('nephos', 'ver_info.py')
with open(outfile, 'w+', encoding='utf-8') as ver_file:
ver_file.write(info)
def read(file_name):
"""
Reads data from file for the description parameter of `setup()`.
Parameters
----------
file_name: str
path to the README.md file.
Returns
-------
str
the text contained in the given file.
"""
with open(file_name, mode='r') as readme:
return readme.read()
# update version information before launching setup
update_version()
# Determine Distrubution to pick which installation script to use
DISTRO = platform.dist()[0]
if DISTRO.lower() in ["centos", "ubuntu", "debian"]:
subprocess.run("sudo ./install.sh")
else:
print('I cannot run installation script!')
sys.exit(1)
setup(
name=__title__,
version=__version__,
url="https://github.com/thealphadollar/Nephos.wiki",
download_url="https://github.com/thealphadollar/Nephos",
license=__license__,
author=__author__,
author_email=__author_mail__,
description=__description__,
long_description=read('README.md'),
keywords='network stream closed_captions subtitles',
install_requires=[
'pydash',
'coloredlogs',
'PyYAML',
'click',
'apscheduler',
'sqlalchemy',
'pytz',
'tzlocal',
'oauth2client',
'google-api-python-client'
],
setup_requires=[
'pytest-runner'
],
test_requires=[
'pytest',
'mock',
'unittest'
],
entry_points={
'console_scripts': ['nephos=nephos:main']
},
zip_safe=False,
include_package_data=True
)