Skip to content

Commit

Permalink
Add Python 3.12 to test matrix as upper bound and fix findings
Browse files Browse the repository at this point in the history
This is done in advance to open the door for upgrading to newer Python
versions on seeedsigner-os at any time.

Fixes / required changes:
* Fix `E   ValueError: mutable default <class 'seedsigner.views.view.Destination'> for field next_destination is not allowed: use default_factory`
* Install package during CI with pip instead of calling the setup.py (which
  got deprecated a while a ago and breaks with Python 3.11/3.12)
* Update Pillow version to 10.0.1 = first version with Python 3.12 support
  • Loading branch information
dbast committed May 16, 2024
1 parent 9aa95e8 commit b7f1439
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]
# 3.10: currently used by Seedsigner
# 3.12: latest stable Python as upper test bound
python-version: ["3.10", "3.12"]

steps:
- uses: actions/checkout@v3
Expand All @@ -34,7 +36,7 @@ jobs:
sudo apt-get install libzbar0
python -m pip install --upgrade pip
pip install -r requirements.txt -r tests/requirements.txt
python setup.py install
pip install .
- name: Test with pytest
run: |
mkdir artifacts
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
embit==0.7.0
Pillow==9.4.0
Pillow==10.0.1
pyzbar @ git+https://github.com/seedsigner/pyzbar.git@c3c237821c6a20b17953efe59b90df0b514a1c03
qrcode==7.3.1
urtypes @ git+https://github.com/selfcustody/urtypes.git@7fb280eab3b3563dfc57d2733b0bf5cbc0a96a6a
4 changes: 2 additions & 2 deletions src/seedsigner/views/view.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from dataclasses import dataclass
from dataclasses import dataclass, field
from typing import Type

from seedsigner.gui.components import FontAwesomeIconConstants, SeedSignerIconConstants
Expand Down Expand Up @@ -313,7 +313,7 @@ class ErrorView(View):
status_headline: str = None
text: str = None
button_text: str = None
next_destination: Destination = Destination(MainMenuView, clear_history=True)
next_destination: Destination = field(default_factory=lambda: Destination(MainMenuView, clear_history=True))


def run(self):
Expand Down

0 comments on commit b7f1439

Please sign in to comment.