What changed, and why it matters
This commit only updates documentation. It renames a link, adds a note about Python style checkers, updates a tutorial's example code to include a standard Python import, and changes two example commit links. There is no change to the actual Trezor firmware, software, or build process.
No security action needed. This is a routine documentation update.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff is confined to three Markdown files under docs/. Changes are: (1) docs/SUMMARY.md renames a navigation link; (2) docs/core/misc/codestyle.md adds a note recommending from __future__ import annotations to satisfy style checkers in trezorlib; (3) docs/developers/hello_world_in_core.md updates the referenced single-commit implementation link and adds from __future__ import annotations to two code snippets. No source code, build scripts, tests, or configuration files are modified.
Changed components
docs/SUMMARY.mddocs/core/misc/codestyle.mddocs/developers/hello_world_in_core.mdInspect captured patch +12 / −3
diff --git a/docs/SUMMARY.md b/docs/SUMMARY.md
index 5a8840323..05b6149b6 100644
--- a/docs/SUMMARY.md
+++ b/docs/SUMMARY.md
@@ -58,4 +58,4 @@
- [TOIF Image Format](misc/toif.md)
- [Developers guide](developers/index.md)
- [Libraries](developers/libraries.md)
- - [Hello World in Core](developers/hello_world_in_core.md)
+ - [Hello World in Trezor Core](developers/hello_world_in_core.md)
diff --git a/docs/core/misc/codestyle.md b/docs/core/misc/codestyle.md
index 580f9ba7d..7c4c5a150 100644
--- a/docs/core/misc/codestyle.md
+++ b/docs/core/misc/codestyle.md
@@ -19,6 +19,11 @@ We prefer Python 3.10 style annotations:
This also applies inside `if TYPE_CHECKING` branches.
+> [!NOTE]
+> For some Python code, for example in `trezorlib`, style checkers will complain that
+> newer Python is required for the preferred annotation style. To avoid this issue,
+> use `from __future__ import annotations`.
+
#### Type-checking imports
At run-time, the `typing` module is not available. There is compile-time magic that
diff --git a/docs/developers/hello_world_in_core.md b/docs/developers/hello_world_in_core.md
index 69f6999b3..3f81909bf 100644
--- a/docs/developers/hello_world_in_core.md
+++ b/docs/developers/hello_world_in_core.md
@@ -14,7 +14,7 @@ We will implement a simple "hello world" feature where Trezor gets some informat
As already mentioned, to get something useful from Trezor, writing device logic is not enough. We need to have a specific communication channel between the computer and Trezor, and also the computer needs to know how to speak to the device to trigger wanted action.
-### TLDR: [implementation in a single commit](https://github.com/trezor/trezor-firmware/commit/e1cbb8a97018ec3ea39e759bbdc9a5311f992dc5)
+### TLDR: [implementation in a single commit](https://github.com/trezor/trezor-firmware/commit/f43e7828281219b9770eea376e5dd6d5afd6ee3b)
### 1. Communication part (protobuf)
Communication between Trezor and the computer is handled by a protocol called `protobuf`. It allows for the creation of specific messages (containing clearly defined data) that will be exchanged. More details about this can be seen in [docs](../common/communication/index.md).
@@ -143,6 +143,8 @@ We will create the `python/src/trezorlib/hello_world.py` file and fill it with c
#### **`python/src/trezorlib/hello_world.py`**
```python
+from __future__ import annotations
+
from typing import TYPE_CHECKING, Optional
from . import messages
@@ -173,6 +175,8 @@ This function is then called from the `CLI` function, which we will define in `p
#### **`python/src/trezorlib/cli/hello_world.py`**
```python
+from __future__ import annotations
+
from typing import TYPE_CHECKING, Optional
import click
@@ -332,6 +336,6 @@ Note the usage of `trezorlib.hello_world.say_hello`, which we defined earlier, s
If we want to be fully compatible with `CI`, we need to create expected `UI-test` results. The most straightforward way to do it is to run `make test_emu_ui_record` in `core` directory.
## Conclusion
-All changes in one commit can be seen [here](https://github.com/trezor/trezor-firmware/commit/e1cbb8a97018ec3ea39e759bbdc9a5311f992dc5).
+All changes in one commit can be seen [here](https://github.com/trezor/trezor-firmware/commit/f43e7828281219b9770eea376e5dd6d5afd6ee3b).
Ideas for potentially useful Trezor features are welcome. Feel free to submit issues and open PRs, even if incomplete.
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.