-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3b17141
commit c59a90f
Showing
2 changed files
with
65 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,66 @@ | ||
from setuptools import setup, find_packages | ||
import os | ||
import re | ||
import sys | ||
|
||
setup( | ||
name="ha4t", | ||
version="0.0.3", | ||
packages=find_packages(), | ||
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:\projects\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", | ||
) |