Skip to content

Commit 7f834e4

Browse files
authored
Merge pull request #9 from muziing/dev
Version 0.1.12
2 parents 6f8cd95 + 669a056 commit 7f834e4

28 files changed

Lines changed: 3376 additions & 312 deletions

.github/dependabot.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates
2+
3+
version: 2
4+
updates:
5+
- package-ecosystem: "pip"
6+
directory: "/"
7+
schedule:
8+
interval: "weekly"

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@ repos:
1010
- id: end-of-file-fixer
1111

1212
- repo: https://github.com/psf/black
13-
rev: 23.11.0
13+
rev: 23.12.0
1414
hooks:
1515
- id: black
1616
args: [--config, "./pyproject.toml"]
1717

1818
- repo: https://github.com/pycqa/isort
19-
rev: 5.12.0
19+
rev: 5.13.1
2020
hooks:
2121
- id: isort
2222
args: [--settings-path, "./pyproject.toml"]
2323

2424
- repo: https://github.com/astral-sh/ruff-pre-commit
25-
rev: v0.1.6
25+
rev: v0.1.7
2626
hooks:
2727
- id: ruff

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ pip install py2exe-gui
4848

4949
Run:
5050

51+
```shell
52+
py2exe-gui
53+
```
54+
55+
You can run py2exe-gui as a package if running it as a script doesn't work:
56+
5157
```shell
5258
python -m py2exe_gui # `_`, not `-`
5359
```

README_zh.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ pip install py2exe-gui
4848

4949
运行
5050

51+
```shell
52+
py2exe-gui
53+
```
54+
55+
如果以脚本形式运行失败,还可以尝试作为 Python 包运行:
56+
5157
```shell
5258
python -m py2exe_gui # 注意连字符为_
5359
```

dev_scripts/build.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
from dev_scripts.check_funcs import (
99
check_license_statement,
10+
check_mypy,
1011
check_pre_commit,
1112
check_version_num,
1213
)
@@ -72,7 +73,8 @@ def build_py2exe_gui() -> None:
7273
clear_pycache(SRC_PATH)
7374
process_md_images(README_FILE_LIST)
7475
# compile_resources()
75-
print(f"pre-commit检查完毕,返回码:{check_pre_commit()}。")
76+
print(f"pre-commit 检查完毕,返回码:{check_pre_commit()}。")
77+
print(f"mypy 检查完毕,返回码:{check_mypy()}。")
7678

7779
# 正式构建
7880
subprocess.run(["poetry", "build"]) # TODO 处理异常与返回值

dev_scripts/check_funcs.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@
66
import tomllib
77
import warnings
88

9-
from dev_scripts.path_constants import COMPILED_RESOURCES, PROJECT_ROOT, SRC_PATH
9+
from dev_scripts.path_constants import (
10+
COMPILED_RESOURCES,
11+
PROJECT_ROOT,
12+
SRC_PATH,
13+
SRC_PKG_PATH,
14+
)
1015
from py2exe_gui import Constants as py2exe_gui_Constants
1116

1217

@@ -85,6 +90,19 @@ def check_pre_commit() -> int:
8590
return 0
8691

8792

93+
def check_mypy() -> int:
94+
"""
95+
调用mypy进行静态代码分析
96+
"""
97+
98+
mypy_cmd = ["mypy", SRC_PKG_PATH, "--config-file", PROJECT_ROOT / "pyproject.toml"]
99+
print("开始运行 mypy 检查...")
100+
result = subprocess.run(mypy_cmd)
101+
print("mypy 检查运行完毕。")
102+
103+
return result.returncode
104+
105+
88106
def check_requirements() -> int:
89107
"""
90108
检查 requirements.txt 中的依赖是否最新
@@ -97,4 +115,5 @@ def check_requirements() -> int:
97115
check_license_statement()
98116
check_version_num()
99117
check_pre_commit()
118+
check_mypy()
100119
check_requirements()

dev_scripts/path_constants.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77

88
PROJECT_ROOT = Path("../") # 项目根目录
99
SRC_PATH = PROJECT_ROOT / "src" # 源码目录
10-
RESOURCES_PATH = SRC_PATH / "py2exe_gui" / "Resources" # 静态资源文件目录
10+
SRC_PKG_PATH = SRC_PATH / "py2exe_gui"
11+
RESOURCES_PATH = SRC_PKG_PATH / "Resources" # 静态资源文件目录
1112
COMPILED_RESOURCES = RESOURCES_PATH / "compiled_resources.py" # 编译静态资源文件
1213
README_FILE_LIST = [
1314
PROJECT_ROOT / "README.md",

docs/ROADMAP.md

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,29 @@
55
- [ ] 子进程窗口 `SubProcessDlg`
66
- [x] 将子进程的输出与状态显示至单独的对话框
77
- [x] 增加多功能按钮
8-
- [ ] 优化多功能按钮代码、增加功能
98
- [x] 关闭窗口时中断子进程、清除输出
109
- [x] 处理不能正确显示子进程错误的问题(会被“打包完成”遮盖)
1110
- [ ] 增加「将输出导出到日志文件」功能
12-
- [ ] 资源文件添加框
11+
- [ ] 增加简单高亮功能
12+
- [ ] 添加资源文件窗口
13+
- [ ] `--add-data``--add-binary``--paths``--hidden-import`
14+
- [ ] 模仿 Windows “编辑环境变量” 窗口,左侧条目,右侧添加删除编辑等按钮
1315
- [ ] Python 解释器选择器
1416
- [ ] 文件浏览对话框选择解释器可执行文件
1517
- [ ] 处理解释器验证器返回结果,异常时弹出对话框要求用户自行检查确认
1618
- [ ] 创建「解释器环境类」,保存解释器路径等信息
1719
- [ ] ComboBox 中列出各解释器,将解释器环境类保存在userData中
18-
- [ ] 快捷显示已安装的 `PyInstaller` 版本
20+
- [ ] 快捷显示已安装的 `PyInstaller` 版本,未安装则提供「一键安装」
1921
- [ ] (?) 识别系统解释器/venv/Poetry/conda等
2022
- [ ] 命令浏览器
2123
- [x] 显示将传递给 PyInstaller 的选项列表
22-
- [x] 高亮提示(待优化)
23-
- [ ] 优化参数传递接口
24+
- [x] 高亮提示
25+
- [x] 以终端命令格式显示完整命令,并添加续行符
2426
- [ ] "What is this" 提示
27+
- [ ] 右键菜单,添加指向对应 PyInstaller 文档,提供完整帮助信息
2528
- [ ] `PyInstaller` 选项参数详解表格
2629
- [x] 主窗口状态栏显示软件版本
27-
- [ ]简洁模式」/「详尽模式」切换
30+
- [ ]一键调试」模式,自动选择 `--onedir``--console``--debug` 等利于调试的选项
2831

2932
## 打包
3033

@@ -45,20 +48,33 @@
4548

4649
- [x] 实现跨平台功能
4750
- [x] 获取当前运行平台
48-
- [x] 以合理方式保存至某种全局变量中
51+
- [x] 保存至全局变量中
4952
- [x] 定制各平台特有功能
5053
- [x] 使用 `qrc` 管理静态资源
5154
- [ ] 翻译与国际化
55+
- [ ] Qt 提供的界面文本自动翻译
56+
- [ ] 自实现的不同语言下功能差异,如“打开PyInstaller文档”指向不同的链接等
5257

5358
## 应用程序级
5459

5560
- [x] 解决相对引用与作为包运行问题
5661
- [ ] `logging` 日志记录
57-
- [ ] 支持命令行方式
5862
- [ ] 将用户设置保存到文件中存储
59-
- [ ] 支持从 `pyproject.toml` 文件中读取配置
6063

6164
## 美化
6265

6366
- [ ] QSS 与美化
6467
- [ ] 动画效果
68+
69+
## 构建与分发
70+
71+
平台:
72+
73+
- [ ] Windows 发行版
74+
- [ ] Linux 发行版
75+
76+
分发方式:
77+
78+
- [ ] GitHub Releases
79+
- [ ] Arch Linux AUR
80+
- [ ] Ubuntu PPA

poetry.lock

Lines changed: 66 additions & 50 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)