Skip to content

Commit

Permalink
[fix] Package dependency versions updated
Browse files Browse the repository at this point in the history
  • Loading branch information
lpascal-ledger committed Jan 19, 2024
1 parent d227917 commit 617e9bb
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 24 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 7 additions & 10 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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]
13 changes: 1 addition & 12 deletions src/ragger/backend/physical_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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):

Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/functional/test_boilerplate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)

0 comments on commit 617e9bb

Please sign in to comment.