-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
executable file
·78 lines (63 loc) · 2 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
#!/usr/bin/python3
from distutils import log
from setuptools import setup, find_packages, Command
import setuptools.command.test
import subprocess
import os
class TestCommand(setuptools.command.test.test):
"""
Helper for unit testing discovery.
"""
def _test_args(self):
yield 'discover'
for arg in super()._test_args():
yield arg
class PylintCommand(Command):
"""A custom command to run Pylint on all Python source files."""
description = 'run Pylint on Python source files'
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
"""Run command."""
command = ['/usr/bin/pylint3']
command.append(os.path.join(os.getcwd(), 'blrecipe'))
command.append(os.path.join(os.getcwd(), 'tests', 'unit'))
self.announce('Running command: {}'.format(command), level=log.INFO)
try:
subprocess.check_call(command)
except subprocess.CalledProcessError as ex:
self.announce("command returned status {}".format(ex.args[0]), level=log.WARN)
setup(
name='blrecipe',
version='1.0',
author='Stephen M. Webb',
author_email='[email protected]',
packages=find_packages(),
package_data={
'': ['app/templates/*.html', 'app/static/css/*.css', 'app/static/js/*.js'],
},
# Platform-independent command-line drivers
entry_points={
'console_scripts': [
'blrecipe-service = blrecipe.restapi.service:main',
'blrecipe-app = blrecipe.app.__main__:main',
'blrecipe = blrecipe.clt.__main__:main',
]
},
# Unit tests
cmdclass={
'test': TestCommand,
'lint': PylintCommand,
},
test_suite='tests',
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Programming Language :: Python :: 3.7',
'Framework :: Flask',
'Environment :: Console',
'Environment :: Web Environment',
]
)