publish test

This commit is contained in:
xaoyo 2023-11-28 18:30:07 +08:00
parent 07c28a584a
commit 993ff73b61
2 changed files with 7 additions and 7 deletions

View File

@ -34,7 +34,7 @@ jobs:
- name: Build package
run: |
python -m build
pip install dist/*.whl
pip install -U .
python tests/build_exe.py
- name: Build Executable

View File

@ -71,14 +71,14 @@ with open("dist/tmp.py", "w", encoding="utf-8") as f:
package_path = site.getsitepackages()
if package_path:
package_path = package_path[1] # 假设取第一个安装包的路径
root_path = os.path.join(package_path, 'pywxdump')
require_path = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "requirements.txt")
print(require_path)
# 读取依赖
current_path = os.path.dirname(os.path.abspath(__file__)) # 当前文件所在路径
require_path = os.path.join(os.path.dirname(current_path), "requirements.txt") # requirements.txt 路径
with open(require_path, "r", encoding="utf-8") as f:
hidden_imports = f.read().splitlines()
# 去掉setuptools、wheel
hidden_imports = [i for i in hidden_imports if i not in ["setuptools", "wheel"]]
hidden_imports = [i for i in hidden_imports if i not in ["setuptools", "wheel"]] # 去掉setuptools、wheel
root_path = os.path.join(package_path, 'pywxdump')
# 生成 spec 文件
spec_content = spec_content.format(root_path=root_path, hidden_imports=hidden_imports)