Replace or slim the unmaintained pyautogui stack and its unused dependencies
維護者通常 3 天內回覆
還沒有人認領這個 Issue。
評估
研究方向
Read autoclicker/core/click_engine.py, autoclicker/core/safety.py, and docs/PERFORMANCE.md to understand current input and safety behavior. The issue proposes lazy importing as a short-term change and replacing the dependency with a Win32 backend or maintained alternative as a longer-term plan. Start with the engine tests and real-input CI job; done means agreeing on the backend plan or replacement and meeting the listed import acceptance criterion.
由索引模型根據 Issue 內容生成。
描述
Summary
pyautogui (latest release 0.9.54) and its helpers (pygetwindow, mouseinfo, pymsgbox, pyrect, pyperclip) see little maintenance, and the app uses only a handful of input and pixel calls. Most of the transitive packages are dead weight in the exe and cost startup time.
Where
pyproject.toml:34requirements-lock.txt(pyautogui, pygetwindow, mouseinfo, pymsgbox, pyrect, pyperclip, pyscreeze, pytweening)autoclicker/core/click_engine.py:16(import pyautogui)autoclicker/core/safety.py
Details
The code already calls Win32 directly through pywin32 and ctypes (core/safety.py, core/screen.py). Importing pyautogui pulls in mouseinfo (which calls SetProcessDPIAware and GetDC(0) at import), pyscreeze and pyrect (which imports doctest). python -X importtime -c "import autoclicker.main" shows import pyautogui taking 0.5 to 1.1 s of a cold start.
Impact
Upstream fixes for new Python versions (CI tests 3.14) are unlikely, the bundled code widens the license surface, and every launch and headless run pays the import cost.
Suggested fix
Short term: exclude unused modules in the spec and import pyautogui lazily inside the click engine so the window appears first. Medium term: replace pyautogui with a thin ctypes SendInput/GetPixel wrapper (the deferred Win32 backend in docs/PERFORMANCE.md), reimplementing FAILSAFE semantics, with the engine tests and the real-input CI job as the safety net.
Acceptance criteria
- The click engine no longer imports pyautogui at module import
- Plan agreed for the SendInput backend, or a maintained replacement chosen
Getting started
- Relevant files:
autoclicker/core/click_engine.py,autoclicker/core/safety.py,docs/PERFORMANCE.md - How to run tests:
make check(Git Bash) ortasks.bat lint,tasks.bat typecheck,tasks.bat test(cmd). Single test:python -m pytest tests/test_x.py::TestClass::test_name --no-cov - Related docs:
CONTRIBUTING.md,docs/ARCHITECTURE.md
Filed by repo-audit/full-audit at 9968dc8. Severity: medium. Effort: L. audit-key: dependencies|pyproject.toml|pyautogui
- 主要語言
- Python
- 星號
- 0
- 分支
- 2
- 平均合併
- 2 天 13 小時
- 30 天內合併 PR
- 2
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
TMHSDigital/autoclicker 的其他 Issue
-
maintenance priority: low
難度 3/5 半天 新手友好度 56/100
TMHSDigital/autoclicker#202 ·
維護者通常 3 天內回覆
-
bug priority: low
難度 3/5 1-2 天 新手友好度 52/100
TMHSDigital/autoclicker#201 ·
維護者通常 3 天內回覆
-
marketing packaging priority: low
難度 4/5 3-5 天 新手友好度 38/100
TMHSDigital/autoclicker#118 · 1 則留言 ·
維護者通常 3 天內回覆
-
documentation marketing priority: medium
難度 3/5 1-2 天 新手友好度 55/100
TMHSDigital/autoclicker#117 · 1 則留言 ·
維護者通常 3 天內回覆
-
ci packaging priority: medium
難度 4/5 3-5 天 新手友好度 47/100
TMHSDigital/autoclicker#91 · 1 則留言 ·
維護者通常 3 天內回覆
查看 TMHSDigital/autoclicker 的全部 Issue
相似的 Issue
-
hive size:simple
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆
-
A new VOLTTRON_HOME starts with agent isolation mode on (string comparison of a boolean default)未關閉
難度 2/5 1-3 小時 新手友好度 68/100
-
難度 2/5 1-3 小時 新手友好度 70/100
painted-porch/marcus#977 ·
維護者通常 1 天內回覆
-
llm translation
難度 2/5 1-3 小時 新手友好度 82/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
FAIRmat-NFDI/sand#239 ·
維護者通常 1 天內回覆