-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
68 lines (59 loc) · 1.95 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
#!/usr/bin/python
# -*- coding: UTF-8 -*-
"""
@file : setup.py.py
@Time : 2020/11/17 8:54
@Author: Tao.Xu
@Email : tao.xu2008@outlook.com
"""
import os
import sys
import re
from setuptools import setup
# 读取文件内容
def read_file(filename):
cur_dir = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(cur_dir, filename), encoding='utf-8') as f:
long_desc = f.read()
return long_desc
# 获取依赖
def read_requirements(filename):
return [line.strip() for line in read_file(filename).splitlines()
if not line.startswith('#')]
def _find_packages():
"""find pckages"""
packages = []
path = '.'
for root, _, files in os.walk(path):
if '__init__.py' in files:
if sys.platform.startswith('linux'):
item = re.sub('^[^A-z0-9_]', '', root.replace('/', '.'))
elif sys.platform.startswith('win'):
item = re.sub('^[^A-z0-9_]', '', root.replace('\\', '.'))
else:
item = re.sub('^[^A-z0-9_]', '', root.replace('/', '.'))
if item is not None:
packages.append(item.lstrip('.'))
return packages
setup(
name='stressrunner',
python_requires='>=3.4.0',
version='1.1.13',
description="A stressrunner similar as TextTestRunner for stress test, support for html report.",
long_description=read_file('README.md'),
long_description_content_type="text/markdown",
author="tao.xu",
author_email='tao.xu2008@outlook.com',
url='https://github.com/txu2k8/stress-runner',
packages=_find_packages(),
install_requires=read_requirements('requirements.txt'),
include_package_data=True,
license="MIT",
keywords=['stress', 'stressrunner', 'html', 'unittest'],
classifiers=[
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Programming Language :: Python :: 3',
],
)