-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsetup.py
More file actions
68 lines (56 loc) · 1.79 KB
/
setup.py
File metadata and controls
68 lines (56 loc) · 1.79 KB
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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, division
import sys
from setuptools.command.test import test as TestCommand
from setuptools import find_packages
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
#import here, cause outside the eggs aren't loaded
import pytest
errno = pytest.main("%s tests" % " ".join(self.test_args))
sys.exit(errno)
def parse_requirements(requirements_file='requirements.txt'):
"""Parse requirements from a requirements file, stripping comments."""
lines = []
with open(requirements_file) as reqs:
for _ in reqs:
line = _.split('#')[0]
if line.strip():
lines.append(line)
return lines
def get_version():
return '2.10.0'
setup(
name='impala_shell',
version=get_version(),
description='Impala Shell.',
long_description=open('README.md').read(),
author='Impala Dev Team',
author_email='dev@cloudera.com',
py_modules=['impala_shell',
'impala_client',
'impala_shell_config_defaults',
'option_parser',
'shell_output',
'TSSLSocketWithWildcardSAN'],
packages=find_packages('impala_shell', exclude=["tests"]),
package_dir={'': 'impala_shell'},
include_package_data=True,
install_requires=parse_requirements('requirements.txt'),
tests_require=["pytest"],
cmdclass={'test': PyTest},
entry_points={
'console_scripts': [
'impala-shell = impala_shell:main'
]
}
)