Skip to content

Instantly share code, notes, and snippets.

@kdmukai
Created March 26, 2026 17:35
Show Gist options
  • Select an option

  • Save kdmukai/2b80bf95d531905b269971f0010df99b to your computer and use it in GitHub Desktop.

Select an option

Save kdmukai/2b80bf95d531905b269971f0010df99b to your computer and use it in GitHub Desktop.
SeedSigner MicroPython v1.27 compatibility report

MicroPython 1.27 Compatibility Report

Target: MicroPython 1.27 | Scan root: src/seedsigner/ Exclusions: gui, hardware, helpers/qr.py

Summary

Metric Value
Files scanned 39
Files with issues 18
Files clean 21
Total issues 102
Syntax errors (mpy-cross) 0
Pattern matches 96
Info (being replaced) 4
Warnings (unverified deps) 2
Compatibility score 53.8% clean files
Issue density 9.2 per 1000 lines

Issues by Category

# Category Count Files Description
1 @dataclass 25 encode_qr.py, settings_definition.py, screensaver.py, view.py MicroPython has no dataclasses module
2 Type annotations 31 controller.py, mnemonic_generation.py, decode_qr.py, encode_qr.py (+9 more) MicroPython does not support PEP 604 (X
3 logging 13 controller.py, decode_qr.py, psbt_parser.py, seed.py (+9 more) MicroPython has no logging module
4 threading 1 threads.py MicroPython has only _thread, not threading
5 enum.IntEnum 1 decode_qr.py MicroPython has no enum module
6 pathlib 2 settings.py, settings_definition.py MicroPython has no pathlib module
7 gettext 8 settings.py, psbt_views.py, scan_views.py, screensaver.py (+4 more) MicroPython has no gettext module
8 unicodedata 2 mnemonic_generation.py, seed.py MicroPython has no unicodedata module
9 re counted repetitions 4 decode_qr.py MicroPython's re does not support {n}, {m,n} counted repetitions, named groups, or non-capturing groups
10 importlib 1 controller.py MicroPython has no importlib module
11 os.fsync 1 settings.py MicroPython has no os
12 platform 1 settings.py MicroPython has no platform module
13 traceback 3 controller.py, fountain_decoder.py MicroPython's traceback is minimal; format_exc() may not work
14 base64 2 decode_qr.py MicroPython has no base64 module (no base32 functions)
15 hmac 1 seed.py MicroPython has no hmac module
17 Third-party dependency 6 controller.py, decode_qr.py, encode_qr.py, screensaver.py (+1 more) Third-party package that may not be available or verified for MicroPython

Fix Reference

1. @dataclass — MicroPython has no dataclasses module. Fix: Convert to explicit __init__ with manual attribute assignment. See: docs/micropython_migration.md §1

2. Type annotations — MicroPython does not support PEP 604 (X | Y), PEP 585 (list[str]), or the typing module. Fix: Remove type annotations from signatures and variable declarations. See: docs/micropython_migration.md §2

3. logging — MicroPython has no logging module. Fix: Use a compat shim: from seedsigner.compat.logging import getLogger. See: docs/micropython_migration.md §3

4. threading — MicroPython has only _thread, not threading. No Thread class; locks lack context manager support. Fix: Use a compat shim: from seedsigner.compat.threading import Thread, Lock. See: docs/micropython_migration.md §4

5. enum.IntEnum — MicroPython has no enum module. Fix: Replace with plain class constants. See: docs/micropython_migration.md §5

6. pathlib — MicroPython has no pathlib module. Fix: Replace pathlib.Path with os.path equivalents. See: docs/micropython_migration.md §6

7. gettext — MicroPython has no gettext module. Fix: Use a compat shim: from seedsigner.compat.l10n import gettext as _. See: docs/micropython_migration.md §7

8. unicodedata — MicroPython has no unicodedata module. NFKD normalization is critical for BIP-39 seed derivation. Fix: Implement NFKD/NFC in seedsigner-c-modules C extension. Must validate against BIP-39 test vectors. See: docs/micropython_migration.md §8

9. re counted repetitions — MicroPython's re does not support {n}, {m,n} counted repetitions, named groups, or non-capturing groups. Fix: Expand {4} to four repeated character classes; use + with len() for ranges. See: docs/micropython_migration.md §9

10. importlib — MicroPython has no importlib module. Fix: Replace importlib.import_module('x') with __import__('x'). See: docs/micropython_migration.md §10

11. os.fsync — MicroPython has no os.fsync. Fix: Guard with if hasattr(os, 'fsync'): os.fsync(...). See: docs/micropython_migration.md §11

12. platform — MicroPython has no platform module. Fix: Use os.uname() as fallback. See: docs/micropython_migration.md §12

13. traceback — MicroPython's traceback is minimal; format_exc() may not work. Fix: Use sys.print_exception() with io.StringIO buffer. See: docs/micropython_migration.md §13

14. base64 — MicroPython has no base64 module (no base32 functions). Fix: Implement pure-Python base32 or add to seedsigner-c-modules. See: docs/micropython_migration.md §14

15. hmac — MicroPython has no hmac module. Fix: Implement pure-Python HMAC using hashlib, or check if embit provides it. See: docs/micropython_migration.md §15

17. Third-party dependency — Third-party package that may not be available or verified for MicroPython. Fix: Verify package works on MicroPython 1.27 or find alternative. See: docs/micropython_migration.md (third-party deps table)

Per-File Details

src/seedsigner/controller.py — 7 issues
Line Category Code
1 logging import logging
3 traceback import traceback
7 Third-party dependency from PIL.Image import Image
25 Type annotations class BackStack(list[Destination]):
57 importlib from importlib import import_module
120 Type annotations image_entropy_preview_frames: list[Image] = None
336 traceback import traceback
src/seedsigner/helpers/mnemonic_generation.py — 6 issues
Line Category Code
2 unicodedata import unicodedata
22 Type annotations def calculate_checksum(mnemonic: list | str, wordlist_language_code: str = S...
22 Type annotations def calculate_checksum(mnemonic: list | str, wordlist_language_code: str = S...
59 Type annotations def generate_mnemonic_from_bytes(entropy_bytes, wordlist_language_code: str =...
64 Type annotations def generate_mnemonic_from_dice(roll_data: str, wordlist_language_code: str =...
85 Type annotations def generate_mnemonic_from_coin_flips(coin_flips: str, wordlist_language_code...
src/seedsigner/helpers/ur2/fountain_decoder.py — 1 issue
Line Category Code
340 traceback import traceback
src/seedsigner/models/decode_qr.py — 11 issues
Line Category Code
1 base64 import base64
3 logging import logging
8 enum.IntEnum from enum import IntEnum
10 Third-party dependency from pyzbar import pyzbar
12 Third-party dependency from urtypes.crypto import PSBT as UR_PSBT
15 base64 from base64 import b32encode, b32decode
318 Type annotations def extract_qr_data(image, is_binary:bool = False) -> str | None:
366 re counted repetitions elif re.search(r"^B\$[2HZ]P[0-9A-Z]{4}", s): # https://github.com/coinkite/BB...
386 re counted repetitions if re.search(r'\d{48,96}', s):
519 re counted repetitions elif re.search(r'^((bc1|tb1|bcr|[123]|[mn])[a-zA-HJ-NP-Z0-9]{25,62})$', s...
1016 re counted repetitions address_match = re.search(r'^((bc1q|tb1q|bcrt1q|bc1p|tb1p|bcrt1p|[123]\...
src/seedsigner/models/encode_qr.py — 14 issues
Line Category Code
6 @dataclass from dataclasses import dataclass
7 Type annotations from typing import List
17 Third-party dependency from urtypes.crypto import PSBT as UR_PSBT
22 @dataclass @dataclass
70 @dataclass @dataclass
86 @dataclass @dataclass
108 @dataclass @dataclass
139 @dataclass @dataclass
148 @dataclass @dataclass
190 @dataclass @dataclass
240 @dataclass @dataclass
281 @dataclass @dataclass
326 @dataclass @dataclass
399 @dataclass @dataclass
src/seedsigner/models/psbt_parser.py — 4 issues
Line Category Code
1 logging import logging
9 Type annotations from typing import List
435 Type annotations def _fill_scope(scope: InputScope | OutputScope):
440 Type annotations def _get_updated_fingerprint(public_key: PublicKey, derivation_path_obj: Deri...
src/seedsigner/models/seed.py — 4 issues
Line Category Code
1 logging import logging
2 unicodedata import unicodedata
4 hmac import hmac
9 Type annotations from typing import List
src/seedsigner/models/seed_storage.py — 1 issue
Line Category Code
1 Type annotations from typing import List
src/seedsigner/models/settings.py — 7 issues
Line Category Code
1 gettext import gettext
2 logging import logging
5 pathlib import pathlib
6 platform import platform
8 Type annotations from typing import List
58 Type annotations def parse_settingsqr(cls, data: str) -> tuple[str, dict]:
138 os.fsync os.fsync(settings_file.fileno())
src/seedsigner/models/settings_definition.py — 10 issues
Line Category Code
2 pathlib import pathlib
3 @dataclass from dataclasses import dataclass
4 Type annotations from typing import Any, List
8 logging import logging
190 Type annotations def get_detected_languages(cls) -> list[tuple[str, str]]:
190 Type annotations def get_detected_languages(cls) -> list[tuple[str, str]]:
418 @dataclass @dataclass
439 Type annotations selection_options: list[tuple[str | int], str] = None
439 Type annotations selection_options: list[tuple[str | int], str] = None
439 Type annotations selection_options: list[tuple[str | int], str] = None
src/seedsigner/models/threads.py — 2 issues
Line Category Code
1 logging import logging
2 threading from threading import Thread, Lock
src/seedsigner/views/psbt_views.py — 1 issue
Line Category Code
1 gettext from gettext import gettext as _
src/seedsigner/views/scan_views.py — 2 issues
Line Category Code
1 logging import logging
4 gettext from gettext import gettext as _
src/seedsigner/views/screensaver.py — 6 issues
Line Category Code
1 logging import logging
6 @dataclass from dataclasses import dataclass
7 gettext from gettext import gettext as _
44 @dataclass @dataclass
46 Type annotations force_partner_logos: bool|None = None
63 Third-party dependency from PIL import Image
src/seedsigner/views/seed_views.py — 5 issues
Line Category Code
1 logging import logging
6 gettext from gettext import gettext as _
276 Type annotations self.mnemonic: list[str] = self.controller.storage.pending_mnemonic
1243 Type annotations def __init__(self, seed_num: int, bip85_data: dict = None, confirmed_list: li...
1333 Type annotations def __init__(self, seed_num: int, bip85_data: dict = None, cur_index: int = N...
src/seedsigner/views/settings_views.py — 4 issues
Line Category Code
1 logging import logging
2 gettext from gettext import gettext as _
34 Type annotations button_data: list[ButtonOption] = [ButtonOption(e.display_name) for e in sett...
113 Type annotations button_data: list[ButtonOption] = []
src/seedsigner/views/tools_views.py — 3 issues
Line Category Code
2 logging import logging
6 gettext from gettext import gettext as _
79 Third-party dependency from PIL import Image
src/seedsigner/views/view.py — 14 issues
Line Category Code
1 logging import logging
2 @dataclass from dataclasses import dataclass
3 gettext from gettext import gettext as _
4 Type annotations from typing import Type
112 Type annotations def run_screen(self, Screen_cls: Type[BaseScreen], **kwargs) -> int | str:
126 @dataclass @dataclass
250 @dataclass @dataclass
291 @dataclass @dataclass
312 @dataclass @dataclass
336 @dataclass @dataclass
363 @dataclass @dataclass
365 Type annotations error: list[str]
394 @dataclass @dataclass
409 @dataclass @dataclass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment