This repository has been archived by the owner on Nov 24, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathsetup.py
79 lines (62 loc) · 1.96 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
#!/usr/bin/env python
"""Support pylint code checker.
pylama_pylint
-------------
pylama_pylint -- Pylint integration to pylama library.
"""
import re
import sys
from os import path as op
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
def _read(fname):
try:
return open(op.join(op.dirname(__file__), fname)).read()
except IOError:
return ''
_meta = _read('pylama_pylint/__init__.py')
_license = re.search(r'^__license__\s*=\s*"(.*)"', _meta, re.M).group(1)
_project = re.search(r'^__project__\s*=\s*"(.*)"', _meta, re.M).group(1)
_version = re.search(r'^__version__\s*=\s*"(.*)"', _meta, re.M).group(1)
class __PyTest(TestCommand):
test_args = []
test_suite = True
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = ['tests.py']
self.test_suite = True
def run_tests(self):
import pytest
errno = pytest.main(self.test_args)
sys.exit(errno)
setup(
name=_project,
version=_version,
license=_license,
description=_read('DESCRIPTION').strip(),
long_description=_read('README.rst'),
platforms=('Any'),
author='Kirill Klenov',
author_email='horneds@gmail.com',
url='http://github.com/klen/pylama_pylint',
classifiers=[
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
],
# The project is depricated
# So do not need register this as pylama linter anymore
# entry_points={
# 'pylama.linter': [
# 'pylint = pylama_pylint.main:Linter',
# ],
# },
packages=find_packages(),
package_data={'pylama_pylint': ['pylint.rc']},
install_requires=[
l for l in _read('requirements.txt').split('\n')
if l and not l.startswith('#')],
tests_require=['pytest'],
cmdclass={'test': __PyTest},
)