-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
134 lines (123 loc) · 4.79 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
import sys
import platform
import os
from setuptools import setup
from setuptools.command.test import test as TestCommand
class PyTest(TestCommand):
"""
Test-runner
"""
user_options = [('pytest-args=', 'a', 'Arguments to pass to py.test')]
def __init__(self, *args, **kwargs):
super(PyTest, self).__init__(*args, **kwargs)
self.pytest_args = None
self.test_suite = None
def initialize_options(self):
TestCommand.initialize_options(self)
self.pytest_args = list()
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = list()
self.test_suite = True
def run_tests(self):
# import here, cause outside the eggs aren't loaded
import pytest
err_no = pytest.main(self.pytest_args)
sys.exit(err_no)
def main():
# Check python version
if sys.version_info < (3, 0, 0):
sys.stderr.write(
'You need python 3.0 or later to run this script!' + os.linesep
)
exit(1)
# Generate requires
if 'Windows' in platform.system():
requirements_file = 'windows.txt'
elif 'Linux' in platform.system():
requirements_file = 'linux.txt'
else:
requirements_file = 'default.txt'
requirements_file = os.path.join('requirements', requirements_file)
with open(requirements_file) as requirements_reader:
requires = requirements_reader.read().splitlines()
# Get package description
with open('README.MD') as readme_reader:
long_description = readme_reader.read()
# Describe installer
settings = {
'name': 'pc_monitoring',
'version': '0.0.6',
'author': 'gunantos',
'author_email': '[email protected]',
'maintainer': 'gunantos',
'maintainer_email': '[email protected]',
'packages': ['pc_monitoring'],
'url': 'https://github.com/gunantos/pc_monitoring',
'download_url': 'https://github.com/gunantos/pc_monitoring/releases',
'license': 'MIT',
'description': 'pc_monitoring is a Python cross-platform tool for '
'monitoring OS resources.',
'long_description': long_description,
'install_requires': requires,
'keywords': [
'pc_monitoring', 'monitoring',
'monitoring', 'tool',
'statistic', 'stats',
'computer', 'pc', 'server',
'mem', 'memory',
'network', 'net', 'io',
'processor', 'cpu',
'hdd', 'hard', 'disk', 'drive'
],
'platforms': 'Platform Independent',
'package_data': {
'pc_monitoring': ['LICENSE', 'README.MD']
},
'scripts': ['console.py'],
'tests_require': ['pytest>=2.6.2'],
'cmdclass': {'test': PyTest},
'classifiers': [
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Environment :: MacOS X',
'Environment :: Win32 (MS Windows)',
'Intended Audience :: Developers',
'Intended Audience :: Information Technology',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: BSD License',
'Natural Language :: English',
'Operating System :: OS Independent',
'Operating System :: MacOS',
'Operating System :: Microsoft :: Windows',
'Operating System :: POSIX :: Linux',
'Operating System :: POSIX',
'Operating System :: Unix',
'Programming Language :: C',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.0',
'Programming Language :: Python :: 3.1',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Software Development :: Libraries',
'Topic :: System :: Benchmark',
'Topic :: System :: Hardware',
'Topic :: System :: Monitoring',
'Topic :: System :: Networking :: Monitoring',
'Topic :: System :: Networking',
'Topic :: System :: Systems Administration',
'Topic :: Utilities',
],
}
setup(**settings)
if __name__ == '__main__':
main()