-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
66 lines (58 loc) · 2.32 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
import os
import re
import sys
import setuptools
from setuptools import find_packages
with open("./ha4t/__init__.py", 'r', encoding="utf-8") as f:
content = f.read()
# from https://www.py4u.net/discuss/139845
version = re.search(r'__version__\s*=\s*[\'"]([^\'"]*)[\'"]', content).group(1)
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
def is_docker():
if os.path.exists('/proc/self/cgroup'):
with open('/proc/self/cgroup', 'rt') as ifh:
return 'docker' in ifh.read()
return False
def parse_requirements(filename):
""" load requirements from a pip requirements file. (replacing from pip.req import parse_requirements)"""
lineiter = (line.strip() for line in open(filename, encoding="utf-8"))
reqs = [line for line in lineiter if line and not line.startswith("#")]
if sys.platform == "win32":
reqs.append('pywin32')
# if py<=3.6 add dataclasses
if sys.version_info.major == 3 and sys.version_info.minor <= 6:
reqs.append("dataclasses")
if sys.version_info.major == 3 and sys.version_info.minor <= 7:
reqs.remove("facebook-wda>=1.3.3")
reqs.append("facebook-wda<1.4.8")
if is_docker():
reqs.remove("opencv-contrib-python>=4.4.0.46, <=4.6.0.66")
reqs.append("opencv-contrib-python-headless==4.5.5.64")
return reqs
setuptools.setup(
name="HA4T",
version=version,
author="caishilong",
author_email="[email protected]",
description="跨平台的UI自动化框架,适用于混合型app",
long_description=long_description,
long_description_content_type="text/markdown",
license='Apache License 2.0',
url="https://github.com/exuils/HA4T",
install_requires=parse_requirements(r'D:\project\nico\HA4T\requirements.txt'),
packages=find_packages(exclude=("tests",)),
keywords=['automation', 'automated-test', 'game', 'android', 'ios', "hybrid-app"],
extras_require={
"dev": ["flake8", "black==22.3.0", "isort", "twine", "pytest", "wheel"],
},
package_data={
'ha4t': ['binaries/*'], # 包含 ha4t/bin 目录下的所有文件
},
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
python_requires=">=3.7",
)