Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

strategy:
matrix:
python-version: [3.10.8, 3.11, 3.12, 3.13]
python-version: [3.10.8, 3.11, 3.12, 3.13, 3.14]
install_variant: ["pip"]
include:
- python-version: 3.12
Expand Down
8 changes: 6 additions & 2 deletions guibot/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,8 +473,12 @@ def __synchronize_backend(
"Backend '%s' has not been configured yet" % backend
)

import autopy

try:
import autopy
except ImportError:
raise UninitializedBackendError(
"AutoPy is not installed for this Python version/platform"
)
self._backend_obj = autopy

self._scale = self._backend_obj.screen.scale()
Expand Down
14 changes: 9 additions & 5 deletions packaging/pip_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,22 @@
Pillow==12.3.0

# backends
autopy==4.0.1; python_version >= '3.8' and platform_python_implementation != "PyPy"
autopy==4.0.2; python_version >= '3.8' and platform_python_implementation != "PyPy"
# OCR is currently not tested on Windows due to custom Tesseract OCR installers
pytesseract==0.3.13; sys_platform != 'win32'
tesserocr==2.7.1; sys_platform != 'win32'
# TODO: OpenCV and PyTorch don't control their "numpy" dependency
numpy==1.26.4; python_version < '3.12' and platform_python_implementation != "PyPy"
numpy==2.2.4; python_version >= '3.12' and platform_python_implementation != "PyPy"
opencv-contrib-python==4.11.0.86; platform_python_implementation != "PyPy"
numpy==2.2.4; python_version >= '3.12' and python_version < '3.14' and platform_python_implementation != "PyPy"
numpy==2.2.4; python_version >= '3.14' and platform_python_implementation != "PyPy"
opencv-contrib-python==4.11.0.86; python_version < '3.14' and platform_python_implementation != "PyPy"
opencv-contrib-python==4.11.0.86; python_version >= '3.14' and platform_python_implementation != "PyPy"
torch==2.2.0; python_version < '3.12' and 'generic' not in platform_release and platform_python_implementation != "PyPy"
torch==2.6.0; python_version >= '3.12' and 'generic' not in platform_release and platform_python_implementation != "PyPy"
torch==2.6.0; python_version >= '3.12' and python_version < '3.14' and 'generic' not in platform_release and platform_python_implementation != "PyPy"
torch>=2.9.0; python_version >= '3.14' and 'generic' not in platform_release and platform_python_implementation != "PyPy"
torchvision==0.17.0; python_version < '3.12' and 'generic' not in platform_release and platform_python_implementation != "PyPy"
torchvision==0.21.0; python_version >= '3.12' and 'generic' not in platform_release and platform_python_implementation != "PyPy"
torchvision==0.21.0; python_version >= '3.12' and python_version < '3.14' and 'generic' not in platform_release and platform_python_implementation != "PyPy"
torchvision>=0.24.0; python_version >= '3.14' and 'generic' not in platform_release and platform_python_implementation != "PyPy"
vncdotool==0.12.0; sys_platform != 'win32' and platform_python_implementation != "PyPy"
pyautogui==0.9.54; platform_python_implementation != "PyPy"

Expand Down
5 changes: 4 additions & 1 deletion tests/test_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def wrapper(*args, **kwargs):
return decorator


@unittest.skipIf(os.environ.get('DISABLE_AUTOPY', "0") == "1", "AutoPy disabled")
class ControllerTest(unittest.TestCase):

@classmethod
Expand Down Expand Up @@ -390,7 +391,9 @@ def test_keys_type(self) -> None:
"""Check key type effect for all display controller backends."""
for display in self.backends:
# include some modifiers without direct effect in this case
for modifiers in [None, [display.keymap.ALT]]:
alt_key = getattr(getattr(display, 'keymap', None), 'AlT', None)
modifier_list = [None, [alt_key]] if alt_key else [None]
for modifiers in modifier_list:
shutil.rmtree(self.logpath, ignore_errors=True)
self.show_application()

Expand Down
9 changes: 7 additions & 2 deletions tests/test_interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,18 @@
# You should have received a copy of the GNU Lesser General Public License
# along with guibot. If not, see <http://www.gnu.org/licenses/>.

import os
import unittest
import sys
import inspect
from unittest import main, mock, TestCase

import common_test


try:
import autopy
except ImportError:
autopy = None
class SimpleAPITest(TestCase):

def setUp(self) -> None:
Expand Down Expand Up @@ -64,7 +69,7 @@ def test_key_imports(self, mock_guibot) -> None:
self.assertEqual(buttons.mod.MOD_SHIFT, "")
self.assertEqual(buttons.mouse.LEFT_BUTTON, 1)


@unittest.skipIf(os.environ.get('DISABLE_AUTOPY', "0") == "1", "AutoPy disabled")
class ProxyAPITest(TestCase):

def setUp(self) -> None:
Expand Down
1 change: 1 addition & 0 deletions tests/test_region_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
from guibot.errors import *


@unittest.skipIf(os.environ.get('DISABLE_AUTOPY', "0") == "1", "Autopy disabled")
class RegionTest(unittest.TestCase):

@classmethod
Expand Down