Replace or slim the unmaintained pyautogui stack and its unused dependencies

Abierto
#154 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 3 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
35/100
Tipo de issue
Refactorización
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
python
Área
desktop, devtools

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

Lenguaje dominante
Python
Estrellas
0
Forks
2
Merge medio
2 d 13 h
PR fusionados (30 d)
2

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de TMHSDigital/autoclicker

Todos los issues de TMHSDigital/autoclicker

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.