-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.py
More file actions
65 lines (52 loc) · 1.56 KB
/
setup.py
File metadata and controls
65 lines (52 loc) · 1.56 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
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import sys
import re
import os
from os.path import dirname, abspath
from setuptools import setup, find_packages
def find_version(*paths):
fname = os.path.join(*paths)
with open(fname) as fhandler:
version_file = fhandler.read()
version_match = re.search(r"^__VERSION__ = ['\"]([^'\"]*)['\"]",
version_file, re.M)
if not version_match:
raise RuntimeError("Unable to find version string in %s" % (fname,))
version = version_match.group(1)
return version
def find_readme(*paths):
with open(os.path.join(*paths)) as f:
return f.read()
version = find_version('kaelib', '__init__.py')
needs_pytest = {'pytest', 'test', 'ptr'}.intersection(sys.argv)
pytest_runner = ['pytest-runner'] if needs_pytest else []
requires = [
'requests>=2.20.0',
'websocket-client==0.54.0',
'humanfriendly==4.17',
'addict==2.2.0',
'marshmallow==2.17.0',
]
root_dir = dirname(abspath(__file__))
setup(
name='kaelib',
version=version,
description='kae api library',
long_description=find_readme('README.md'),
long_description_content_type='text/markdown',
author='Yu Yang',
author_email='yangyu@geetest.com',
url='https://github.com/kaecloud/kaelib',
include_package_data=True,
packages=find_packages(root_dir),
install_requires=requires,
setup_requires=pytest_runner,
tests_require=[
"pyyaml",
"pytest-cov",
"pytest-randomly",
"pytest-mock",
"pytest>3.0",
],
)