-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
66 lines (57 loc) · 2.02 KB
/
setup.py
File metadata and controls
66 lines (57 loc) · 2.02 KB
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
import json
import os
from typing import List
from setuptools import setup, find_packages
version_json_path = 'version.json'
if not os.path.exists(version_json_path):
with open(version_json_path, 'w') as f:
f.write(
json.dumps(
{
'MAJOR': 0,
'MINOR': 0,
'MICRO': 0
}
)
)
version_json = json.load(open(version_json_path))
version = ".".join([str(version_json[i]) for i in ['MAJOR', 'MINOR', 'MICRO']])
def get_requirements_to_install() -> List[str]:
__curr_location__ = os.path.realpath(os.path.join(os.getcwd(), os.path.dirname(__file__)))
requirements_txt_file_as_str = f'{__curr_location__}/requirements.txt'
with open(requirements_txt_file_as_str, 'r') as reqfile:
libs = reqfile.readlines()
for i in range(len(libs)):
libs[i] = libs[i].replace('\n', '')
return libs
def get_description() -> str:
__curr_location__ = os.path.realpath(os.path.join(os.getcwd(), os.path.dirname(__file__)))
requirements_txt_file_as_str = f'{__curr_location__}/README.rst'
with open(requirements_txt_file_as_str, 'r') as reqfile:
desc = reqfile.read()
return desc
setup(
name='sys-stats',
version=version,
description='An open-source Python tool to provide system stats over a web interface.',
long_description=get_description(),
install_requires=get_requirements_to_install(),
author='Amith Koujalgi',
author_email='koujalgi.amith@gmail.com',
packages=find_packages(include=['sys_stats', 'sys_stats.api']),
package_data={
'sys_stats': ['static/*', 'static/**/*'],
},
entry_points={
'console_scripts': [
'sys-stats = sys_stats.sys_stats_cli:main'
],
},
zip_safe=False,
classifiers=[
'Intended Audience :: Developers',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.8',
]
)