Skip to content

Commit

Permalink
打包修复
Browse files Browse the repository at this point in the history
  • Loading branch information
1103837067 committed Oct 18, 2024
1 parent 3b17141 commit c59a90f
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ha4t/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.0.3"
__version__ = "0.0.4"
__all__ = ["__version__", "connect", "device", "driver", "Device", "screen_size"]

import json
Expand Down
69 changes: 64 additions & 5 deletions setup.py
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",
)

0 comments on commit c59a90f

Please sign in to comment.