Skip to content

Commit

Permalink
Merge pull request #9 from muziing/dev
Browse files Browse the repository at this point in the history
Version 0.1.12
  • Loading branch information
muziing authored Dec 12, 2023
2 parents 6f8cd95 + 669a056 commit 7f834e4
Show file tree
Hide file tree
Showing 28 changed files with 3,376 additions and 312 deletions.
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates

version: 2
updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ repos:
- id: end-of-file-fixer

- repo: https://github.com/psf/black
rev: 23.11.0
rev: 23.12.0
hooks:
- id: black
args: [--config, "./pyproject.toml"]

- repo: https://github.com/pycqa/isort
rev: 5.12.0
rev: 5.13.1
hooks:
- id: isort
args: [--settings-path, "./pyproject.toml"]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.6
rev: v0.1.7
hooks:
- id: ruff
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ pip install py2exe-gui

Run:

```shell
py2exe-gui
```

You can run py2exe-gui as a package if running it as a script doesn't work:

```shell
python -m py2exe_gui # `_`, not `-`
```
Expand Down
6 changes: 6 additions & 0 deletions README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ pip install py2exe-gui

运行

```shell
py2exe-gui
```

如果以脚本形式运行失败,还可以尝试作为 Python 包运行:

```shell
python -m py2exe_gui # 注意连字符为_
```
Expand Down
4 changes: 3 additions & 1 deletion dev_scripts/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

from dev_scripts.check_funcs import (
check_license_statement,
check_mypy,
check_pre_commit,
check_version_num,
)
Expand Down Expand Up @@ -72,7 +73,8 @@ def build_py2exe_gui() -> None:
clear_pycache(SRC_PATH)
process_md_images(README_FILE_LIST)
# compile_resources()
print(f"pre-commit检查完毕,返回码:{check_pre_commit()}。")
print(f"pre-commit 检查完毕,返回码:{check_pre_commit()}。")
print(f"mypy 检查完毕,返回码:{check_mypy()}。")

# 正式构建
subprocess.run(["poetry", "build"]) # TODO 处理异常与返回值
Expand Down
21 changes: 20 additions & 1 deletion dev_scripts/check_funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@
import tomllib
import warnings

from dev_scripts.path_constants import COMPILED_RESOURCES, PROJECT_ROOT, SRC_PATH
from dev_scripts.path_constants import (
COMPILED_RESOURCES,
PROJECT_ROOT,
SRC_PATH,
SRC_PKG_PATH,
)
from py2exe_gui import Constants as py2exe_gui_Constants


Expand Down Expand Up @@ -85,6 +90,19 @@ def check_pre_commit() -> int:
return 0


def check_mypy() -> int:
"""
调用mypy进行静态代码分析
"""

mypy_cmd = ["mypy", SRC_PKG_PATH, "--config-file", PROJECT_ROOT / "pyproject.toml"]
print("开始运行 mypy 检查...")
result = subprocess.run(mypy_cmd)
print("mypy 检查运行完毕。")

return result.returncode


def check_requirements() -> int:
"""
检查 requirements.txt 中的依赖是否最新
Expand All @@ -97,4 +115,5 @@ def check_requirements() -> int:
check_license_statement()
check_version_num()
check_pre_commit()
check_mypy()
check_requirements()
3 changes: 2 additions & 1 deletion dev_scripts/path_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@

PROJECT_ROOT = Path("../") # 项目根目录
SRC_PATH = PROJECT_ROOT / "src" # 源码目录
RESOURCES_PATH = SRC_PATH / "py2exe_gui" / "Resources" # 静态资源文件目录
SRC_PKG_PATH = SRC_PATH / "py2exe_gui"
RESOURCES_PATH = SRC_PKG_PATH / "Resources" # 静态资源文件目录
COMPILED_RESOURCES = RESOURCES_PATH / "compiled_resources.py" # 编译静态资源文件
README_FILE_LIST = [
PROJECT_ROOT / "README.md",
Expand Down
34 changes: 25 additions & 9 deletions docs/ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,29 @@
- [ ] 子进程窗口 `SubProcessDlg`
- [x] 将子进程的输出与状态显示至单独的对话框
- [x] 增加多功能按钮
- [ ] 优化多功能按钮代码、增加功能
- [x] 关闭窗口时中断子进程、清除输出
- [x] 处理不能正确显示子进程错误的问题(会被“打包完成”遮盖)
- [ ] 增加「将输出导出到日志文件」功能
- [ ] 资源文件添加框
- [ ] 增加简单高亮功能
- [ ] 添加资源文件窗口
- [ ] `--add-data``--add-binary``--paths``--hidden-import`
- [ ] 模仿 Windows “编辑环境变量” 窗口,左侧条目,右侧添加删除编辑等按钮
- [ ] Python 解释器选择器
- [ ] 文件浏览对话框选择解释器可执行文件
- [ ] 处理解释器验证器返回结果,异常时弹出对话框要求用户自行检查确认
- [ ] 创建「解释器环境类」,保存解释器路径等信息
- [ ] ComboBox 中列出各解释器,将解释器环境类保存在userData中
- [ ] 快捷显示已安装的 `PyInstaller` 版本
- [ ] 快捷显示已安装的 `PyInstaller` 版本,未安装则提供「一键安装」
- [ ] (?) 识别系统解释器/venv/Poetry/conda等
- [ ] 命令浏览器
- [x] 显示将传递给 PyInstaller 的选项列表
- [x] 高亮提示(待优化)
- [ ] 优化参数传递接口
- [x] 高亮提示
- [x] 以终端命令格式显示完整命令,并添加续行符
- [ ] "What is this" 提示
- [ ] 右键菜单,添加指向对应 PyInstaller 文档,提供完整帮助信息
- [ ] `PyInstaller` 选项参数详解表格
- [x] 主窗口状态栏显示软件版本
- [ ]简洁模式」/「详尽模式」切换
- [ ]一键调试」模式,自动选择 `--onedir``--console``--debug` 等利于调试的选项

## 打包

Expand All @@ -45,20 +48,33 @@

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

## 应用程序级

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

## 美化

- [ ] QSS 与美化
- [ ] 动画效果

## 构建与分发

平台:

- [ ] Windows 发行版
- [ ] Linux 发行版

分发方式:

- [ ] GitHub Releases
- [ ] Arch Linux AUR
- [ ] Ubuntu PPA
116 changes: 66 additions & 50 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 7f834e4

Please sign in to comment.