forked from nvdv/vprof
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
151 lines (117 loc) · 3.76 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
142
143
144
145
146
147
148
149
150
151
"""Setup script for vprof."""
import glob
import pip
import shlex
import subprocess
import unittest
from distutils import cmd
from setuptools import setup
from setuptools.command.install import install
from pip.req import parse_requirements
from pip.download import PipSession
class RunUnittestsCommand(cmd.Command):
description = 'Run all unittests'
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
suite = unittest.TestLoader().discover(
'vprof/tests/.', pattern="*_test.py")
unittest.TextTestRunner(verbosity=2, buffer=True).run(suite)
subprocess.check_call(shlex.split('npm run test'))
class RunEndToEndTestCommand(cmd.Command):
description = 'Run all end to end tests'
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
suite = unittest.TestLoader().discover(
'vprof/tests/.', pattern="*_e2e.py")
unittest.TextTestRunner(verbosity=2, buffer=True).run(suite)
class RunLintCommand(cmd.Command):
description = 'Run linter'
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
subprocess.check_call(shlex.split('npm run lint'))
subprocess.check_call(shlex.split(
'pylint --reports=n --rcfile=pylint.rc ' + ' '.join(
glob.glob('vprof/*.py'))))
subprocess.check_call(shlex.split(
'pylint --reports=n --rcfile=pylint.rc ' + ' '.join(
glob.glob('vprof/tests/*.py'))))
class RunCleanCommand(cmd.Command):
description = 'Clean temporary files'
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
subprocess.check_output(
shlex.split('rm -rf vprof/frontend/vprof_min.js'))
class RunDepsInstallCommand(cmd.Command):
description = 'Install dependencies'
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
pip.main(['install', '-r', 'requirements.txt'])
pip.main(['install', '-r', 'dev_requirements.txt'])
subprocess.check_call(
shlex.split('npm install'))
class VProfBuild(install):
def run(self):
subprocess.check_call(shlex.split('npm run build'))
class VProfInstall(install):
def run(self):
install.run(self)
setup(
name='vprof',
version='0.3',
packages=['vprof'],
description="Visual profiler for Python",
url='http://github.com/nvdv/vprof',
license='BSD',
author='nvdv',
author_email='[email protected]',
include_package_data=True,
keywords=['debugging', 'profiling'],
entry_points={
'console_scripts': [
'vprof = vprof.__main__:main'
]
},
classifiers=[
'Development Status :: 3 - Alpha',
'Environment :: Web Environment',
'Intended Audience :: Developers',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Topic :: Software Development',
],
install_requires=[
str(req.req) for req in parse_requirements('requirements.txt',
session=PipSession())
],
cmdclass={
'test': RunUnittestsCommand,
'e2e_test': RunEndToEndTestCommand,
'lint': RunLintCommand,
'deps_install': RunDepsInstallCommand,
'build_ui': VProfBuild,
'install': VProfInstall,
},
)