foolproof-operation 1.1.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. foolproof_operation-1.1.1/CHANGELOG.md +117 -0
  2. foolproof_operation-1.1.1/LICENSE +21 -0
  3. foolproof_operation-1.1.1/MANIFEST.in +31 -0
  4. foolproof_operation-1.1.1/PKG-INFO +113 -0
  5. foolproof_operation-1.1.1/README.en.md +94 -0
  6. foolproof_operation-1.1.1/README.md +85 -0
  7. foolproof_operation-1.1.1/docs/usn-indexer.md +244 -0
  8. foolproof_operation-1.1.1/foolproof_operation/__init__.py +18 -0
  9. foolproof_operation-1.1.1/foolproof_operation/__main__.py +31 -0
  10. foolproof_operation-1.1.1/foolproof_operation/cli.py +488 -0
  11. foolproof_operation-1.1.1/foolproof_operation/core/__init__.py +56 -0
  12. foolproof_operation-1.1.1/foolproof_operation/core/audit.py +179 -0
  13. foolproof_operation-1.1.1/foolproof_operation/core/context.py +548 -0
  14. foolproof_operation-1.1.1/foolproof_operation/core/events.py +119 -0
  15. foolproof_operation-1.1.1/foolproof_operation/core/loader.py +256 -0
  16. foolproof_operation-1.1.1/foolproof_operation/core/runtime.py +129 -0
  17. foolproof_operation-1.1.1/foolproof_operation/core/tasklog.py +157 -0
  18. foolproof_operation-1.1.1/foolproof_operation/flows.py +213 -0
  19. foolproof_operation-1.1.1/foolproof_operation/foolproof.composition.json +58 -0
  20. foolproof_operation-1.1.1/foolproof_operation/gui.py +1252 -0
  21. foolproof_operation-1.1.1/foolproof_operation/index/__init__.py +62 -0
  22. foolproof_operation-1.1.1/foolproof_operation/index/paths.py +264 -0
  23. foolproof_operation-1.1.1/foolproof_operation/index/probe.py +324 -0
  24. foolproof_operation-1.1.1/foolproof_operation/index/service.py +373 -0
  25. foolproof_operation-1.1.1/foolproof_operation/index/store.py +516 -0
  26. foolproof_operation-1.1.1/foolproof_operation/index/usn.py +685 -0
  27. foolproof_operation-1.1.1/foolproof_operation/panels.py +197 -0
  28. foolproof_operation-1.1.1/foolproof_operation/plugins/__init__.py +12 -0
  29. foolproof_operation-1.1.1/foolproof_operation/plugins/categories.py +252 -0
  30. foolproof_operation-1.1.1/foolproof_operation/plugins/installer.py +166 -0
  31. foolproof_operation-1.1.1/foolproof_operation/plugins/pip.py +276 -0
  32. foolproof_operation-1.1.1/foolproof_operation/plugins/reqtxt.py +129 -0
  33. foolproof_operation-1.1.1/foolproof_operation/plugins/scanner.py +368 -0
  34. foolproof_operation-1.1.1/foolproof_operation/plugins/search.py +497 -0
  35. foolproof_operation-1.1.1/foolproof_operation/requirements_categories.json +816 -0
  36. foolproof_operation-1.1.1/foolproof_operation/tools/everything/LICENSE +21 -0
  37. foolproof_operation-1.1.1/foolproof_operation/tools/everything/README.md +39 -0
  38. foolproof_operation-1.1.1/foolproof_operation/tools/everything/es.exe +0 -0
  39. foolproof_operation-1.1.1/foolproof_operation.egg-info/PKG-INFO +113 -0
  40. foolproof_operation-1.1.1/foolproof_operation.egg-info/SOURCES.txt +61 -0
  41. foolproof_operation-1.1.1/foolproof_operation.egg-info/dependency_links.txt +1 -0
  42. foolproof_operation-1.1.1/foolproof_operation.egg-info/entry_points.txt +2 -0
  43. foolproof_operation-1.1.1/foolproof_operation.egg-info/requires.txt +4 -0
  44. foolproof_operation-1.1.1/foolproof_operation.egg-info/top_level.txt +1 -0
  45. foolproof_operation-1.1.1/pyproject.toml +63 -0
  46. foolproof_operation-1.1.1/requirements-dbg.spec +49 -0
  47. foolproof_operation-1.1.1/requirements.spec +57 -0
  48. foolproof_operation-1.1.1/requirements.txt +2 -0
  49. foolproof_operation-1.1.1/setup.cfg +4 -0
  50. foolproof_operation-1.1.1/tests/__init__.py +4 -0
  51. foolproof_operation-1.1.1/tests/test_context.py +374 -0
  52. foolproof_operation-1.1.1/tests/test_events.py +131 -0
  53. foolproof_operation-1.1.1/tests/test_flows.py +239 -0
  54. foolproof_operation-1.1.1/tests/test_installer_plugins.py +437 -0
  55. foolproof_operation-1.1.1/tests/test_loader.py +241 -0
  56. foolproof_operation-1.1.1/tests/test_ops_plugins.py +300 -0
  57. foolproof_operation-1.1.1/tests/test_panels.py +227 -0
  58. foolproof_operation-1.1.1/tests/test_paths.py +175 -0
  59. foolproof_operation-1.1.1/tests/test_plugins.py +509 -0
  60. foolproof_operation-1.1.1/tests/test_probe.py +158 -0
  61. foolproof_operation-1.1.1/tests/test_service.py +355 -0
  62. foolproof_operation-1.1.1/tests/test_store.py +343 -0
  63. foolproof_operation-1.1.1/tests/test_usn.py +304 -0
@@ -0,0 +1,117 @@
1
+ # Changelog
2
+
3
+ 本项目所有值得注意的变更都会记录在此文件中。
4
+
5
+ 格式基于 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/),版本号遵循 [语义化版本](https://semver.org/lang/zh-CN/)。
6
+
7
+ ## [1.1.1] - 2026-09-23
8
+
9
+ ### Added
10
+
11
+ - **(阶段 D)发布打包配置**:新增 `pyproject.toml`(名称 `foolproof-operation`、MIT、`requires-python>=3.8`、
12
+ **运行时零依赖**、console script `foolproof-operation = foolproof_operation.__main__:main`)与 `MANIFEST.in`。
13
+ 防膨胀口径参照 `G:\repos\an-engine` 的教训:**关闭 `include-package-data` 自动收录**(pyproject 模式下默认 True,
14
+ 会把包内所有已跟踪文件打进 wheel),改用显式 `package-data` 白名单(分类清单 / 插件清单 / 内置 es.exe 及其 LICENSE);
15
+ sdist 清单排除运行期产物(失败日志、重试日志、`*.bak-*`、基准 JSON)。
16
+ 实测:wheel 238 KB / 解包 595 KB,条目仅包与 5 个白名单数据文件 + dist-info(**零日志/基准/测试/文档**);
17
+ 干净 venv 安装后控制台脚本与 `python -m foolproof_operation` 均 exit 0,包内资源在位。
18
+ - **(阶段 C)GUI 两个面板**:工具栏新增「📋 任务日志」与「🐍 环境发现」入口,均为**独立窗口**(不动既有主界面布局)。
19
+ - 📋 任务日志:读 JSONL 流水 → 按事件名过滤(输入即筛)/ 只看失败 / 刷新 / 清空;顶部显示条数·首末时间·失败计数,失败行标 ⚠。
20
+ - 🐍 环境发现:按后端(auto/index/es/walk/legacy)列出候选环境(类型/路径/版本/解释器,含 ✓✗ 深验证标记),
21
+ 显示**来源后端与各后端尝试原因**、索引状态摘要(已建/未建/被拒),可对选定卷**一键建库 / 增量同步**(后台线程)。
22
+ - 实现:数据逻辑在界面无关的 `foolproof_operation/panels.py`(`TaskLogModel` / `EnvPanelModel`),GUI 只做渲染与按钮接线;
23
+ GUI 冒烟协议同步扩展为「启动主窗口 + 真的打开两个面板 + 关闭」。
24
+ - **环境发现(索引驱动)**:新增 `cli envs` —— 基于本机 NTFS **USN/MFT 元数据索引**发现 Python 环境,
25
+ 覆盖目录名启发式看不见的深层 venv(如 `G:\notpython\kard_CN\venv`)。选项:`--build`(索引缺失时先建,
26
+ 只读卷、不创建 USN journal)、`--deep`(逐个真跑解释器验证)、`--json`(导出)、`--volumes`、`--backend`。
27
+ 实测本机 5 卷 479 万条记录建库 ≈50s,发现 **208 个环境候选**(187 venv / 20 standalone / 1 embed),
28
+ 而原 `scan` 口径为 **4 个**;查询延迟 0.02~1.46ms。原理、实测与许可记账见 `docs/usn-indexer.md`。
29
+ - **检索后端三级回退**:`index`(本仓索引)→ `es`(内置 Everything 命令行,MIT © voidtools)→
30
+ `walk`(目录遍历)依次回退,且每次检索都记录**每个后端的尝试与原因**(缺索引 / Everything 未运行 /
31
+ 拒绝整盘遍历 / 命中条数),不静默降级。整盘遍历默认拒绝(`--allow-whole-drives` 显式许可),
32
+ 另有 30s 墙钟预算兜底并标注「结果可能不全」。
33
+ - **Cordis 式可逆插件内核(零第三方依赖)**:`core/` 提供 Context(服务注册表 + effect 逆序回收 +
34
+ `fork` 作用域 + 事务化清单装配),`foolproof.composition.json` 为插件清单,
35
+ `plugins/search.py`、`plugins/scanner.py` 为插件行;`core/runtime.py` 供 CLI/GUI 共用装配。
36
+ 服务可见性与回收责任分离(服务冒泡到 realm 根、disposer 留在注册者),多实例私有服务用 `isolate`。
37
+ - `cli scan --backend index|auto`:在保持原 glob 口径(默认 `walk`)之外,可选走插件化发现。
38
+ - 测试:新增 `tests/`(stdlib `unittest`,214 例),覆盖内核语义、USN 解析、路径还原、索引库、
39
+ 插件回退与溯源、清单装配;另含「批量名字查询必须命中索引」的 `EXPLAIN QUERY PLAN` 性能护栏。
40
+ - 文档:新增 `docs/usn-indexer.md`(原理 / 实测 / 权限矩阵 / 性能基准 / 踩坑记录)
41
+ 与实盘基准 JSON(`docs/usn-bench-*.json`、`docs/usn-store-bench-2026-09-23.json`、`docs/usn-envs-2026-09-23.json`)。
42
+ - **插件化迁移(阶段 5)**:把四类逻辑迁入插件行 —— `plugins/categories.py`(分类清单 +
43
+ 启动审计 fail-loud + 模糊匹配/规格拆分/pip 查询名)、`plugins/pip.py`(子进程调用 + 报错解读 +
44
+ 健康检查 + 两种修复方式)、`plugins/reqtxt.py`(requirements.txt 解析 + 逐条安装编排)、
45
+ `plugins/installer.py`(安装/卸载/检查/升级编排,`inject = pip + categories`)。
46
+ 清单扩至 **8 行**;`cli.py` 与 `requirements.py` 保留同名入口,内部委托插件。
47
+ **行为零变化有硬证据**:以 `git archive HEAD` 快照为基线,迁移前后 **52 项断言逐字一致**
48
+ (分类数与键、`target_of`/`split_spec`/`pip_query_name`/`is_local_spec`、
49
+ `find_category` 的 `SystemExit` 措辞、`_resolve_packages` 各分支、`cmd_list` 全量与单分类输出、
50
+ requirements.txt 解析、`stderr_tail`/`failure_hint` 映射)。
51
+ - 唯一**有意硬化**:`cli check` 在 `pip show` 超时/异常时按「未安装」处理(原实现在该路径会抛栈)。
52
+ - GUI 的流程编排(线程 / 日志 / 音效 / 进度)保持原样,仅叶子逻辑改为委托插件。
53
+ - **任务日志与启动审计(阶段 6,B 类模板标配)**:`core/tasklog.py`(JSONL 操作流水,
54
+ 默认落用户级目录、可用 `FOOLPROOF_TASKLOG` 覆盖、写失败不影响主流程)+ `cli tasks`
55
+ (事件计数 / 失败计数 / 最近记录 / `--json` / `--clear`);`core/audit.py` +
56
+ `cli doctor`(一次核完插件清单、分类清单、索引状态、检索后端、日志可写性,只读,
57
+ 有 error 时退出码 1)。清单扩至 **10 行**(新增 `tasklog` / `audit`)。
58
+ `install`/`uninstall`/`check` 在**不改变任何 stdout** 的前提下静默记录事件。
59
+
60
+ ### Changed
61
+
62
+ - **(阶段 B)GUI 五条流程迁出界面层**:安装 / 一键更新 / 卸载 / 版本检查 / requirements.txt 安装
63
+ 原本内联在 `gui.py`(各自拼 pip 命令 + 写日志 + 播声音),现抽到界面无关的
64
+ `foolproof_operation/flows.py`(只依赖 `installer`/`pip` 服务与一个 `Sink` 输出槽),
65
+ GUI 方法变成薄适配器;`_check_pip` / `_do_repair` 也改为调用 `PipService.health()` / `repair()`。
66
+ 配套:`PipService.show()` 严格区分「未安装 / 查询异常」(此前合并成 `None` 会让两类日志混淆)、
67
+ `InstallerService.check_pairs()` 支持 GUI 的「显示名 → value」对;GUI 关窗时回收插件运行时。
68
+ **行为零变化**:以阶段 A 提交快照为基准,用同一探针驱动真实 GUI 流程方法(打桩 pip 低层,
69
+ 含成功与失败分支),前后日志/音效/失败日志序列 **57 行逐字一致**;新增 `tests/test_flows.py`
70
+ 以逐条断言锁住日志文本与音效序列。
71
+ - **(结构层)代码收进 `foolproof_operation` 包**,为 PyPI 发布铺路:平铺的 `core/` `index/` `plugins/`
72
+ `cli.py` `requirements.py` 移入包目录(`gui.py`),清单与内置 es.exe 随包分发;包内导入改相对形式,
73
+ 插件清单里的动态导入改全路径。仓库根保留 `requirements.py` / `cli.py` **兼容 shim**,
74
+ 老命令 `python requirements.py cli …` 继续可用;新增 `python -m foolproof_operation [cli …]` 统一入口。
75
+ 两个 PyInstaller spec 改为 `SPECPATH` 相对路径 + 包内资源 + 带包名的 `hiddenimports`。
76
+ **行为零变化**:与重构前快照对照,52 项可观测断言逐字一致。
77
+ 原因:直接以平铺布局发布会在 site-packages 留下 `core/` `index/` `plugins/` 这类通用顶层名
78
+ (与其它包高概率冲突),且顶层绝对导入在安装后必然 ImportError。
79
+ - README / README.en 去本地化:绝对路径改为 `<PATH>` 占位符,首屏补仓库链接与 MIT 许可声明;
80
+ 两版逐节对齐(章节 / 要点数 / 占位符数量一致),分类与库数统一为「24 分类 / 761 个库」。
81
+
82
+ ### Fixed
83
+
84
+ - **GBK 控制台下 `cli` 因 emoji 直接崩**(既有缺陷,打包冒烟时暴露):分类名含 emoji,
85
+ 在默认代码页 936 的控制台打印时抛 `UnicodeEncodeError: 'gbk' codec can't encode character '\U0001f3ae'`,
86
+ **源码版与冻结版都会中招**。现于 CLI 入口放宽 stdout/stderr 错误策略(`errors="replace"`):
87
+ 中文正常、emoji 退化为 `?`,命令不再崩;要完整显示可 `set PYTHONIOENCODING=utf-8`(README 已注明)。
88
+ - 便携版打包 spec(`requirements.spec`):原写死绝对路径且**漏收运行期资源与新模块** ——
89
+ 现改用 `SPECPATH` 推导,`datas` 补 `foolproof.composition.json`、`LICENSE`、
90
+ `tools/everything/`(ES 后端要用),`hiddenimports` 显式列出插件清单里按字符串动态导入的模块
91
+ (`core.events`/`core.tasklog`/`core.audit`/`core.runtime`/`index.service`/`plugins.*`)——
92
+ 这类遗漏只在冻结版运行时才暴露,已实测修复(重建 exe 后 `cli list`/`doctor`/`envs` 全部 exit 0)。
93
+
94
+ - 自研包随源仓库改名:`alloy` → `allin-engine`。an-engine 于 2026-09-19 把包名与模块名由 `alloy` 改为 `allin_engine`(PyPI 项目名 `allin-engine`)。本清单同步:「🏠 本地 / 自研包」条目由 `"alloy"` 改为 `"allin-engine"`(值仍为 `-e G:/repos/an-engine`);「🛠️ 工具链」里同名的公开包 `alloy` 条目移除 —— 它本就是 PyPI 上的同名不同项目(Elide 的 High-performance runtime)。
95
+ - **value 现支持 pip 选项前缀**(`shlex.split()`):可写 `"-e G:/repos/an-engine"` 实现 editable 安装。两个自研包已切换到 `-e` 模式(都在活跃开发中,editable 更顺手)。已实测 `pip install --dry-run -e G:/repos/an-engine` → `Would install alloy-1.0.0`。
96
+ - `shlex` 模式按输入自适应:含引号 → `posix=True`;无引号但含反斜杠 → `posix=False`(否则 `G:\repos` 会被吃掉分隔符且**不报错**);其余 → `posix=True`。路径建议写正斜杠最省心。
97
+ - 接入自研包:「🏠 本地 / 自研包」收录 `alloy` → `G:/repos/an-engine`(统一游戏引擎 v1.0.0)、`bloodmusic` → `G:/repos/audio-generation`(程序化音频合成引擎 v2.0.0),值为本地仓库路径。
98
+ - **新增本地路径型 value 支持**:`requirements_categories.json` 的值原为 PyPI 包名,现允许写本地路径。安装照常 `pip install <路径>`;而 `pip show` / `pip uninstall` 需要的是包名,故新增 `cli.pip_query_name()`,路径型 value 自动回退到显示名(GUI 与 CLI 共用)。已实测:`pip install --dry-run G:/repos/an-engine` → `Would install alloy-1.0.0`。
99
+ - **修复 CLI 忽略 value 的缺陷**:`cli.py` 原先把分类内层 dict 的**键**当作 pip 包名,导致 `value` 形同虚设——带 extras 的条目(如 `fastapi[all]`)装成裸包,`--category` 批量安装同样受影响。现改为用 `value` 安装、用包名检查/卸载。
100
+ - 明确「🏠 本地 / 自研包」判定标准:**联网(PyPI / GitHub / Gitee)搜不到同名同项目**才算自研,仅凭包名眼生不算,PyPI 同名不同项目也不算。原 9 个条目逐包联网核验后**无一属自研** —— `alloy` 在 PyPI 上是 Elide 的 "High-performance runtime"(作者 Sam Gammon),与本地自研的 `an-engine`/alloy 无关;其归属最终由自研仓库接入(见上条)。
101
+ - 9 个包按实际来源归位:`alloy` · `ast_serialize`(mypyc 官方)· `offshoot`(SerpentAI 插件系统)→ 工具链;`udapi` · `udtools`(Universal Dependencies)→ 自然语言处理;`datarecorder`(g1879/DrissionPage 生态)→ 爬虫网络;`sswg`(静态网站生成器)→ Web 开发;`pyvers`(依赖多版本管理)→ 打包构建;`groovy`(gradio-app 的 SSRF 防护)→ 加密安全。
102
+ - 「🏠 本地 / 自研包」转为**手动维护**分类:自动扫描因 `_pypi_exists()` 过滤掉 PyPI 上不存在的包,纯自研包天然无法被收录(这正是 `bloodmusic` 从未出现在清单中的原因),故需手动加入;已收录 `bloodmusic`。
103
+ - 全量核验:自动归类的 760 个包在 PyPI 均可查询(0 个 404);手动收录的 `bloodmusic` 为 PyPI 404,属预期。
104
+ - ComfyUI 生态归位:`comfy-aimdo` · `comfy-angle` · `comfy-kitchen` 与 `comfyui-*` 系列同属 `comfy*` 前缀,整组归入「🤖 AI / 机器学习」(共 14 个),不再按包名拆分。
105
+ - 分类体系整理:全盘扫描积累在「🔍 自动发现」的 601 个包全部归入 24 个功能分类。新增 9 类——GUI 桌面、音频音乐、LLM Agent、安全渗透、逆向二进制、文档文本、科学计算、打包构建、本地自研包;213 个传递依赖单独归入「📦 传递依赖」,不再混入精选分类。分类总数 15 → 25,条目 764 → 761(剔除 4 条跨分类重复项 + 手动新增 1 条自研包 `bloodmusic`)。
106
+ - 修复 `httpx` / `aiohttp` 同时存在于「🕷️ 爬虫 / 网络」与「⚡ 异步 / 并发」的重复收录问题;该重复会导致 GUI 勾选状态互相覆盖(UI 以包名为 key)。
107
+ - 「🔍 自动发现」分类保留为空,继续作为后续扫描的落点。
108
+ - 新增 `classify_auto.py`(dry-run 默认 / `--write` 落盘),承载本次归类映射表,可复现、可增量复用。
109
+ - 文档同步:README / README.en 的分类数与脚本名更正为 `requirements.py`。
110
+ - 与 siwpan/requirements 归一同源:合入其更新版本的工具链与打包 spec(requirements.py 重试/镜像工具链;2026-08-27 深度审核 R6——两仓实为同一项目「傻瓜式操作」,requirements 仓已退役改名 requirements-legacy)。
111
+
112
+ ## [1.0.0] - 2026-08-27
113
+
114
+ ### Added
115
+
116
+ - 首个发行版:便携源码 zip(剔除 .venv/构建产物/输出物,依赖见 README)。
117
+ - 发布面:gitee [siwpan/foolproof-operation](https://gitee.com/siwpan/foolproof-operation) release `v1.0.0`(依赖库安装器 v1.0.0)。
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 siwpan
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,31 @@
1
+ # sdist 清单(wheel 内容由 pyproject.toml 的 package-data 白名单控制)
2
+ #
3
+ # 原则:源码包只装「构建与运行需要的东西 + 文档」,**不带运行期产物**
4
+ # (失败日志.txt / 重试安装日志.txt / *.bak-* / 基准 JSON / __pycache__ / build / dist)。
5
+
6
+ include LICENSE
7
+ include README.md
8
+ include README.en.md
9
+ include CHANGELOG.md
10
+ include pyproject.toml
11
+ include requirements.txt
12
+ include requirements.spec
13
+ include requirements-dbg.spec
14
+
15
+ recursive-include foolproof_operation *.py *.json *.md *.exe
16
+ recursive-include docs *.md
17
+ recursive-include tests *.py
18
+
19
+ # 运行期产物与本地杂物:一律不进 sdist
20
+ exclude 失败日志.txt
21
+ exclude 重试安装日志.txt
22
+ exclude 失败日志分析报告.md
23
+ exclude mirror_retry_list.json
24
+ exclude retry_candidates.json
25
+ exclude retry_final_list.json
26
+ exclude retry_install_list.json
27
+ global-exclude *.py[cod] *.bak *.bak-* __pycache__/*
28
+ prune build
29
+ prune dist
30
+ prune .venv
31
+ prune .gitee
@@ -0,0 +1,113 @@
1
+ Metadata-Version: 2.4
2
+ Name: foolproof-operation
3
+ Version: 1.1.1
4
+ Summary: Python 依赖库安装器(tkinter GUI + CLI):分类管理、批量安装/卸载/更新、pip 健康检查,以及基于 NTFS USN/MFT 索引的全盘环境发现
5
+ Author: siwpan
6
+ License: MIT
7
+ Project-URL: Homepage, https://gitee.com/siwpan/foolproof-operation
8
+ Project-URL: Repository, https://gitee.com/siwpan/foolproof-operation
9
+ Project-URL: Changelog, https://gitee.com/siwpan/foolproof-operation/blob/master/CHANGELOG.md
10
+ Keywords: python,pip,package-manager,tkinter,gui,environment-discovery,usn,mft,ntfs,everything
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Environment :: Win32 (MS Windows)
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Operating System :: Microsoft :: Windows
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3 :: Only
18
+ Classifier: Topic :: Software Development :: Build Tools
19
+ Classifier: Topic :: System :: Systems Administration
20
+ Classifier: Topic :: Utilities
21
+ Requires-Python: >=3.8
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+ Provides-Extra: dev
25
+ Requires-Dist: build>=1.0; extra == "dev"
26
+ Requires-Dist: twine>=4.0; extra == "dev"
27
+ Dynamic: license-file
28
+
29
+ # Python 依赖库安装器
30
+
31
+ > 仓库:<https://gitee.com/siwpan/foolproof-operation> | 许可:MIT(见 [LICENSE](LICENSE))
32
+ > 注:文中 <PATH> 为路径占位符,请替换为你本机实际的目录 / 可执行文件路径。
33
+
34
+ 图形化 Python 依赖库管理工具:**24 个功能分类、761 个库**,另设「🔍 自动发现」桶承接待归类项。
35
+
36
+ ## 功能
37
+
38
+ - **分类管理** — 24 大功能分类、761 个库:游戏开发 / AI 机器学习 / LLM Agent / Web 开发 / 爬虫网络 / 数据可视化 / 数据库 / 图像音视频 / 音频音乐 / 办公自动化 / GUI 桌面 / 异步并发 / 加密安全 / 安全渗透 / 逆向二进制 / 工具链 / 打包构建 / 自然语言处理 / 文档文本 / 科学计算 / 云服务 DevOps / 自动化测试 / 本地自研包 / 传递依赖
39
+ - **自动发现分类** — 全盘扫描到的、尚未归类的包会落入「🔍 自动发现」(当前 3 条待归类),等待人工归类
40
+ - **本地 / 自研包** — 判定标准是「联网(PyPI / GitHub / Gitee)搜不到同名同项目」,仅凭包名眼生不算,PyPI 上有同名不同项目也不算(如 `alloy` 在 PyPI 上是 Elide 的 runtime,与本地自研版无关)。已收录 `allin-engine`(<PATH>,统一游戏引擎,2026-09-19 由 alloy 改名)、`bloodmusic`(<PATH>),值均为本地仓库路径。
41
+ - **批量安装** — 勾选库名一键安装,支持 pip install -U
42
+ - **批量卸载** — 勾选库名一键卸载
43
+ - **版本检查** — 一次检查所有选中库的安装状态和更新情况
44
+ - **一键更新** — 批量更新选中库到最新版
45
+ - **pip 健康检查** — 启动自动检测 pip 状态,支持三种修复方案
46
+ - **全盘扫描** — 扫描系统中的所有 Python 环境及已安装包
47
+ - **环境发现(索引驱动)** — 基于本机 NTFS 的 USN/MFT 元数据索引做环境发现,
48
+ 可覆盖目录名启发式看不见的深层 venv;索引不可用时**显式回退** Everything / 目录遍历
49
+ - **requirements.txt 支持** — 读取任意目录的 requirements.txt,可视化勾选安装
50
+ - **任务日志与启动审计** — 安装/卸载/检查/建库/发现等操作写入 JSONL 流水(`cli tasks` 查看);
51
+ `cli doctor` 一次核完插件清单、分类清单、索引状态、检索后端与日志可写性(只读检查)
52
+ - **GUI 面板** — 「📋 任务日志」(按事件过滤 / 只看失败 / 清空)与「🐍 环境发现」
53
+ (候选环境列表 + 来源后端 + 索引状态 + 一键建库 / 增量同步,均走后台线程不卡界面)
54
+
55
+ ## 快速开始
56
+
57
+ ```bash
58
+ # 纯标准库 + tkinter,无需额外依赖
59
+ python requirements.py
60
+
61
+ # 指定目标 Python 解释器(默认使用运行本工具的 Python)
62
+ python requirements.py --python python
63
+ ```
64
+
65
+ ## 命令行接口(cmd / PowerShell 直接可用)
66
+
67
+ `python requirements.py cli <子命令>`,无 `cli` 参数时仍打开图形界面:
68
+
69
+ ```bash
70
+ python requirements.py cli list # 列出全部分类与库名
71
+ python requirements.py cli list --category 加密 # 只列某个分类(可省略 emoji/写片段)
72
+ python requirements.py cli install requests aiohttp # 安装指定库
73
+ python requirements.py cli install --category Web # 安装整个分类
74
+ python requirements.py cli install --file req.txt # 按 requirements.txt 安装
75
+ python requirements.py cli install --all --upgrade # 全量安装并升级
76
+ python requirements.py cli uninstall requests # 卸载
77
+ python requirements.py cli check --category 数据库 # 版本与更新检查
78
+ python requirements.py cli scan # 扫描全盘 Python 环境(原 glob 口径)
79
+ python requirements.py cli envs # 环境发现(索引驱动,覆盖深层 venv)
80
+ python requirements.py cli envs --build # 同上,索引缺失时先建索引(只读卷)
81
+ python requirements.py cli envs --deep --json e.json # 逐个真跑解释器验证 + 落 JSON
82
+ python requirements.py cli envs --backend walk --volumes <PATH> # 指定兜底遍历目录
83
+ python requirements.py cli es -n 20 "*.py" # Everything 搜索(内置 es.exe)
84
+ python requirements.py cli doctor # 启动审计:清单/分类/索引/后端/日志
85
+ python requirements.py cli tasks # 任务日志(JSONL 操作流水)
86
+ ```
87
+
88
+ - `install/uninstall/check` 可用 `--python <exe>` 指定目标解释器;
89
+ - `es` 需本机 Everything 主程序/服务在运行(详见 `foolproof_operation/foolproof_operation/foolproof_operation/tools/everything/README.md`,
90
+ ES 为 MIT © voidtools);
91
+ - `scan` 是历史口径(glob + 目录名启发式,会漏深层 venv);`envs` 走
92
+ `foolproof.composition.json` 装配的插件,按 **index → es → walk** 依次回退,
93
+ 并打印「是哪个后端答的」与失败原因(缺索引 / Everything 未运行 / 拒绝整盘遍历等)。
94
+ - `envs` 的 `--volumes` 传给遍历后端时请写**具体目录**:盘符根(`G:\`)会触发整盘遍历
95
+ (分钟~小时级),默认被拒绝,确需整盘请显式加 `--allow-whole-drives`。
96
+ - 分类名自带 emoji;若你的控制台是 GBK 代码页(Windows 中文默认 936),emoji 会退化成 `?`
97
+ (命令不会崩);想完整显示先执行 `set PYTHONIOENCODING=utf-8`。
98
+
99
+ ## 配置
100
+
101
+ 编辑 `foolproof_operation/requirements_categories.json` 增删分类和库名。格式为 `{"显示名": "pip 安装目标"}`:
102
+
103
+ - **普通包**:值写 PyPI 包名,可带 extras,如 `"fastapi": "fastapi[all]"`;
104
+ - **自研 / 本地包**:值写本地仓库路径,如 `"bloodmusic": "<PATH>"`。安装时执行
105
+ `pip install <路径>`;版本检查与卸载需要包名,会自动回退用显示名(见 `cli.pip_query_name()`)。
106
+ - **pip 选项前缀**:值经 `shlex.split()` 解析,可带选项,如 `"-e <PATH>"`
107
+ (editable 安装)。路径建议用正斜杠;含空格时用双引号包裹,如 `'-e "<PATH> pkg"'`。
108
+
109
+ 「🏠 本地 / 自研包」是**手动维护**分类:全盘扫描会跳过 PyPI 上不存在的包,纯自研包不会被自动收录。
110
+
111
+ ## 依赖
112
+
113
+ - Python >= 3.8 + tkinter (标准库)
@@ -0,0 +1,94 @@
1
+ # Python Dependency Installer (foolproof-operation)
2
+
3
+ > Repository: <https://gitee.com/siwpan/foolproof-operation> | License: MIT (see [LICENSE](LICENSE))
4
+ > Note: `<PATH>` is a placeholder for a directory / executable path — replace it with the real one on your machine.
5
+
6
+ A tkinter GUI tool for managing **761 Python packages across 24 functional categories**, plus an
7
+ "🔍 Auto-discovery" bucket for packages that are not filed yet.
8
+
9
+ ## Features
10
+
11
+ - **Category management** — 24 functional categories, 761 packages: game dev / AI & ML / LLM agents / web / scraping & networking / visualization / database / image & media / audio & music / office automation / GUI & desktop / async & concurrency / crypto & security / pentesting / reverse engineering / toolchain / packaging & build / NLP / document & text / scientific computing / cloud & DevOps / automated testing / local in-house packages / transitive dependencies
12
+ - **Auto-discovery bucket** — packages found by a full-disk scan that are not filed anywhere yet land in "🔍 Auto-discovery" (3 awaiting triage), waiting for manual sorting
13
+ - **Local / in-house packages** — the test is "no same-name, same-project match on PyPI / GitHub / Gitee"; an unfamiliar name alone does not qualify, and a same-name-but-different project on PyPI does not qualify either (e.g. `alloy` on PyPI is Elide's runtime, unrelated to the local in-house engine). Currently listed: `allin-engine` (`<PATH>`, the unified game engine, renamed from `alloy` on 2026-09-19) and `bloodmusic` (`<PATH>`); both values are local repository paths.
14
+ - **Batch install** — tick packages and install them in one go, supports `pip install -U`
15
+ - **Batch uninstall** — tick packages and uninstall them in one go
16
+ - **Version check** — check install state and available updates for every selected package at once
17
+ - **One-click upgrade** — batch-upgrade the selected packages to their latest versions
18
+ - **pip health check** — pip state is checked on startup, with three repair paths
19
+ - **Full-disk scan** — scan every Python environment on the machine and the packages installed in it
20
+ - **Index-driven environment discovery** — discovers environments from the local NTFS USN/MFT metadata
21
+ index, so deep virtualenvs that name-based heuristics never see are still found; when the index is
22
+ unavailable it **falls back explicitly** to Everything / directory walking
23
+ - **requirements.txt support** — read a `requirements.txt` from any directory and tick packages to install
24
+ - **Task log and startup audit** — install / uninstall / check / index-build / discovery runs are appended
25
+ to a JSONL history (`cli tasks`), and `cli doctor` checks the plugin manifest, category manifest, index
26
+ state, search backends and log writability in one read-only pass
27
+ - **GUI panels** — "📋 Task log" (filter by event / failures only / clear) and "🐍 Environment discovery"
28
+ (candidate list with the answering backend, index state, one-click index build / incremental sync; all
29
+ work runs in background threads so the window stays responsive)
30
+
31
+ ## Quick start
32
+
33
+ ```bash
34
+ # stdlib + tkinter only, no extra dependencies
35
+ python requirements.py
36
+
37
+ # target a different Python interpreter (defaults to the Python running this tool)
38
+ python requirements.py --python python
39
+ ```
40
+
41
+ ## Command-line interface (works directly in cmd / PowerShell)
42
+
43
+ `python requirements.py cli <subcommand>`; running without `cli` still opens the GUI:
44
+
45
+ ```bash
46
+ python requirements.py cli list # list every category and package
47
+ python requirements.py cli list --category crypto # list one category (emoji optional / partial match)
48
+ python requirements.py cli install requests aiohttp # install the given packages
49
+ python requirements.py cli install --category Web # install a whole category
50
+ python requirements.py cli install --file req.txt # install from a requirements.txt
51
+ python requirements.py cli install --all --upgrade # install everything, upgraded
52
+ python requirements.py cli uninstall requests # uninstall
53
+ python requirements.py cli check --category database # version and update check
54
+ python requirements.py cli scan # scan for Python environments (original glob path)
55
+ python requirements.py cli envs # index-driven environment discovery (deep venvs)
56
+ python requirements.py cli envs --build # same, building the index first if missing (read-only)
57
+ python requirements.py cli envs --deep --json e.json # verify each interpreter for real + dump JSON
58
+ python requirements.py cli envs --backend walk --volumes <PATH> # specify directories for walk fallback
59
+ python requirements.py cli es -n 20 "*.py" # Everything search (bundled es.exe)
60
+ python requirements.py cli doctor # startup audit: manifest/categories/index/backends/log
61
+ python requirements.py cli tasks # task log (JSONL operation history)
62
+ ```
63
+
64
+ - `install` / `uninstall` / `check` accept `--python <exe>` to pick the target interpreter;
65
+ - `es` requires the Everything app/service to be running on this machine (see
66
+ `foolproof_operation/foolproof_operation/foolproof_operation/tools/everything/README.md`; ES is MIT © voidtools);
67
+ - `scan` is the historical path (glob + directory-name heuristics, misses deep virtualenvs); `envs`
68
+ runs the plugins composed by `foolproof.composition.json`, falling back **index → es → walk** and
69
+ printing which backend answered plus why the others did not (no index / Everything not running /
70
+ whole-drive walk refused, …).
71
+ - With `envs`, pass `--volumes` **directories** to the walk fallback: a drive root (`G:\`) means a
72
+ whole-volume walk (minutes to hours) and is refused by default — add `--allow-whole-drives` if you
73
+ really mean it.
74
+ - Category names carry emoji; on a GBK code page (Windows Chinese default 936) they degrade to `?`
75
+ instead of crashing the command. Run `set PYTHONIOENCODING=utf-8` first to render them fully.
76
+
77
+ ## Configuration
78
+
79
+ Edit `foolproof_operation/requirements_categories.json` to add or remove categories and packages. The format is
80
+ `{"Display name": "pip install target"}`:
81
+
82
+ - **Ordinary packages**: the value is a PyPI package name, optionally with extras, e.g. `"fastapi": "fastapi[all]"`;
83
+ - **In-house / local packages**: the value is a local repository path, e.g. `"bloodmusic": "<PATH>"`. Install
84
+ runs `pip install <path>`; version checks and uninstalls need a package name, so they fall back to the
85
+ display name (see `cli.pip_query_name()`).
86
+ - **pip option prefixes**: the value goes through `shlex.split()`, so options are allowed, e.g. `"-e <PATH>"`
87
+ (editable install). Prefer forward slashes in paths; quote paths containing spaces, e.g. `'-e "<PATH> pkg"'`.
88
+
89
+ "🏠 Local / in-house packages" is a **manually maintained** category: the full-disk scan skips packages that
90
+ do not exist on PyPI, so purely in-house packages are never auto-collected.
91
+
92
+ ## Dependencies
93
+
94
+ - Python >= 3.8 + tkinter (stdlib)
@@ -0,0 +1,85 @@
1
+ # Python 依赖库安装器
2
+
3
+ > 仓库:<https://gitee.com/siwpan/foolproof-operation> | 许可:MIT(见 [LICENSE](LICENSE))
4
+ > 注:文中 <PATH> 为路径占位符,请替换为你本机实际的目录 / 可执行文件路径。
5
+
6
+ 图形化 Python 依赖库管理工具:**24 个功能分类、761 个库**,另设「🔍 自动发现」桶承接待归类项。
7
+
8
+ ## 功能
9
+
10
+ - **分类管理** — 24 大功能分类、761 个库:游戏开发 / AI 机器学习 / LLM Agent / Web 开发 / 爬虫网络 / 数据可视化 / 数据库 / 图像音视频 / 音频音乐 / 办公自动化 / GUI 桌面 / 异步并发 / 加密安全 / 安全渗透 / 逆向二进制 / 工具链 / 打包构建 / 自然语言处理 / 文档文本 / 科学计算 / 云服务 DevOps / 自动化测试 / 本地自研包 / 传递依赖
11
+ - **自动发现分类** — 全盘扫描到的、尚未归类的包会落入「🔍 自动发现」(当前 3 条待归类),等待人工归类
12
+ - **本地 / 自研包** — 判定标准是「联网(PyPI / GitHub / Gitee)搜不到同名同项目」,仅凭包名眼生不算,PyPI 上有同名不同项目也不算(如 `alloy` 在 PyPI 上是 Elide 的 runtime,与本地自研版无关)。已收录 `allin-engine`(<PATH>,统一游戏引擎,2026-09-19 由 alloy 改名)、`bloodmusic`(<PATH>),值均为本地仓库路径。
13
+ - **批量安装** — 勾选库名一键安装,支持 pip install -U
14
+ - **批量卸载** — 勾选库名一键卸载
15
+ - **版本检查** — 一次检查所有选中库的安装状态和更新情况
16
+ - **一键更新** — 批量更新选中库到最新版
17
+ - **pip 健康检查** — 启动自动检测 pip 状态,支持三种修复方案
18
+ - **全盘扫描** — 扫描系统中的所有 Python 环境及已安装包
19
+ - **环境发现(索引驱动)** — 基于本机 NTFS 的 USN/MFT 元数据索引做环境发现,
20
+ 可覆盖目录名启发式看不见的深层 venv;索引不可用时**显式回退** Everything / 目录遍历
21
+ - **requirements.txt 支持** — 读取任意目录的 requirements.txt,可视化勾选安装
22
+ - **任务日志与启动审计** — 安装/卸载/检查/建库/发现等操作写入 JSONL 流水(`cli tasks` 查看);
23
+ `cli doctor` 一次核完插件清单、分类清单、索引状态、检索后端与日志可写性(只读检查)
24
+ - **GUI 面板** — 「📋 任务日志」(按事件过滤 / 只看失败 / 清空)与「🐍 环境发现」
25
+ (候选环境列表 + 来源后端 + 索引状态 + 一键建库 / 增量同步,均走后台线程不卡界面)
26
+
27
+ ## 快速开始
28
+
29
+ ```bash
30
+ # 纯标准库 + tkinter,无需额外依赖
31
+ python requirements.py
32
+
33
+ # 指定目标 Python 解释器(默认使用运行本工具的 Python)
34
+ python requirements.py --python python
35
+ ```
36
+
37
+ ## 命令行接口(cmd / PowerShell 直接可用)
38
+
39
+ `python requirements.py cli <子命令>`,无 `cli` 参数时仍打开图形界面:
40
+
41
+ ```bash
42
+ python requirements.py cli list # 列出全部分类与库名
43
+ python requirements.py cli list --category 加密 # 只列某个分类(可省略 emoji/写片段)
44
+ python requirements.py cli install requests aiohttp # 安装指定库
45
+ python requirements.py cli install --category Web # 安装整个分类
46
+ python requirements.py cli install --file req.txt # 按 requirements.txt 安装
47
+ python requirements.py cli install --all --upgrade # 全量安装并升级
48
+ python requirements.py cli uninstall requests # 卸载
49
+ python requirements.py cli check --category 数据库 # 版本与更新检查
50
+ python requirements.py cli scan # 扫描全盘 Python 环境(原 glob 口径)
51
+ python requirements.py cli envs # 环境发现(索引驱动,覆盖深层 venv)
52
+ python requirements.py cli envs --build # 同上,索引缺失时先建索引(只读卷)
53
+ python requirements.py cli envs --deep --json e.json # 逐个真跑解释器验证 + 落 JSON
54
+ python requirements.py cli envs --backend walk --volumes <PATH> # 指定兜底遍历目录
55
+ python requirements.py cli es -n 20 "*.py" # Everything 搜索(内置 es.exe)
56
+ python requirements.py cli doctor # 启动审计:清单/分类/索引/后端/日志
57
+ python requirements.py cli tasks # 任务日志(JSONL 操作流水)
58
+ ```
59
+
60
+ - `install/uninstall/check` 可用 `--python <exe>` 指定目标解释器;
61
+ - `es` 需本机 Everything 主程序/服务在运行(详见 `foolproof_operation/foolproof_operation/foolproof_operation/tools/everything/README.md`,
62
+ ES 为 MIT © voidtools);
63
+ - `scan` 是历史口径(glob + 目录名启发式,会漏深层 venv);`envs` 走
64
+ `foolproof.composition.json` 装配的插件,按 **index → es → walk** 依次回退,
65
+ 并打印「是哪个后端答的」与失败原因(缺索引 / Everything 未运行 / 拒绝整盘遍历等)。
66
+ - `envs` 的 `--volumes` 传给遍历后端时请写**具体目录**:盘符根(`G:\`)会触发整盘遍历
67
+ (分钟~小时级),默认被拒绝,确需整盘请显式加 `--allow-whole-drives`。
68
+ - 分类名自带 emoji;若你的控制台是 GBK 代码页(Windows 中文默认 936),emoji 会退化成 `?`
69
+ (命令不会崩);想完整显示先执行 `set PYTHONIOENCODING=utf-8`。
70
+
71
+ ## 配置
72
+
73
+ 编辑 `foolproof_operation/requirements_categories.json` 增删分类和库名。格式为 `{"显示名": "pip 安装目标"}`:
74
+
75
+ - **普通包**:值写 PyPI 包名,可带 extras,如 `"fastapi": "fastapi[all]"`;
76
+ - **自研 / 本地包**:值写本地仓库路径,如 `"bloodmusic": "<PATH>"`。安装时执行
77
+ `pip install <路径>`;版本检查与卸载需要包名,会自动回退用显示名(见 `cli.pip_query_name()`)。
78
+ - **pip 选项前缀**:值经 `shlex.split()` 解析,可带选项,如 `"-e <PATH>"`
79
+ (editable 安装)。路径建议用正斜杠;含空格时用双引号包裹,如 `'-e "<PATH> pkg"'`。
80
+
81
+ 「🏠 本地 / 自研包」是**手动维护**分类:全盘扫描会跳过 PyPI 上不存在的包,纯自研包不会被自动收录。
82
+
83
+ ## 依赖
84
+
85
+ - Python >= 3.8 + tkinter (标准库)