diff --git a/CHANGELOG.md b/CHANGELOG.md index 5719ef4e..b8f4a030 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.14.1] - 2024-01-19 + +### Fixed +- Update Ragger dependency versions (Speculos, LedgerComm, ledgerCTL), so that latest features can + leverage recent features + ## [1.14.0] - 2024-01-19 ### Added diff --git a/setup.cfg b/setup.cfg index d4cbc2f9..fda4521e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -55,21 +55,18 @@ doc= Jinja2>=3.0 docutils==0.16 # higher versions trigger build bugs with the RTD theme speculos= - speculos>=0.2.8 + speculos>=0.5.0 mnemonic ledgercomm= - ledgercomm - ledgercomm[hid] + ledgercomm>=1.2.1 + ledgercomm[hid]>=1.2.1 pyqt5 pytesseract ledgerwallet= - ledgerwallet>=0.2.3 + ledgerwallet>=0.4.0 pyqt5 pytesseract all_backends= - speculos>=0.2.8 - ledgercomm - ledgercomm[hid] - ledgerwallet>=0.2.3 - pyqt5 - pytesseract + ragger[speculos] + ragger[ledgercomm] + ragger[ledgerwallet] diff --git a/src/ragger/backend/physical_backend.py b/src/ragger/backend/physical_backend.py index a1972bfd..3255875f 100644 --- a/src/ragger/backend/physical_backend.py +++ b/src/ragger/backend/physical_backend.py @@ -15,6 +15,7 @@ """ from pathlib import Path from PIL import Image, ImageOps +from pytesseract import image_to_data, Output from types import TracebackType from typing import List, Optional, Type @@ -24,16 +25,6 @@ from ragger.utils import Crop from .interface import BackendInterface -try: - from pytesseract import image_to_data, Output - - TESSERACT_AVAILABLE = True -except ImportError as e: - if "pytesseract" not in str(e): - raise e - - TESSERACT_AVAILABLE = False - class PhysicalBackend(BackendInterface): @@ -107,8 +98,6 @@ def compare_screen_with_text(self, text: str) -> bool: return True self.init_gui() if self._last_valid_snap_path: - if not TESSERACT_AVAILABLE: - raise ImportError("Missing pytesseract module for this usage") image = Image.open(self._last_valid_snap_path) # Nano (s,sp,x) snapshots are white/blue text on black background, # tesseract cannot do OCR on these. Invert image so it has diff --git a/tests/functional/test_boilerplate.py b/tests/functional/test_boilerplate.py index c1643808..9651e059 100644 --- a/tests/functional/test_boilerplate.py +++ b/tests/functional/test_boilerplate.py @@ -115,7 +115,7 @@ def test_waiting_screen(backend, firmware, navigator): NavInsID.USE_CASE_REVIEW_CONFIRM, NavIns(NavInsID.WAIT_FOR_TEXT_ON_SCREEN, ("WILL NOT BE FOUND", )) ], "Hold to sign", ROOT_SCREENSHOT_PATH, "waiting_screen") - assert "Timeout waiting for screen change" in str(error.exception) + assert "Timeout waiting for screen change" in str(error.value) # Verify the error flow of WAIT_FOR_TEXT_ON_SCREEN instruction backend.exchange_raw(prep_tx_apdu) @@ -125,4 +125,4 @@ def test_waiting_screen(backend, firmware, navigator): NavInsID.USE_CASE_REVIEW_CONFIRM, NavIns(NavInsID.WAIT_FOR_TEXT_NOT_ON_SCREEN, ("T", )) ], "Hold to sign", ROOT_SCREENSHOT_PATH, "waiting_screen") - assert "Timeout waiting for screen change" in str(error.exception) + assert "Timeout waiting for screen change" in str(error.value)