-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
42 lines (31 loc) · 912 Bytes
/
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
import sys
# pylint: disable-msg=no-name-in-module,import-error
from distutils.cmd import Command
from os import getcwd, path
from subprocess import check_call
from setuptools import setup
class PylintCommand(Command):
description = 'run pylint on Python source files'
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
command = ['pylint', getcwd()]
return check_call(command)
class PytestCommand(Command):
description = 'run pytest on Python source files'
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
sys.path.append(path.abspath("."))
command = ['pytest', '-c', 'test/setup.cfg']
return check_call(command)
setup(cmdclass={
'lint': PylintCommand,
'test': PytestCommand
})