Replace or slim the unmaintained pyautogui stack and its unused dependencies

オープン
#154 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 3 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
リファクタリング
明瞭さ
おおむね明確
活発さ
活発
技術スタック
python
領域
desktop, devtools

調査の方向性

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 の本文から書いたものです。

説明

dependencies maintenance priority: medium

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:34
  • requirements-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) or tasks.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時間
マージ済み PR(30日)
2

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

TMHSDigital/autoclicker のほかの issue

TMHSDigital/autoclicker の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。