fix(ci): allow `python_test` to download older python versions
What changed, and why it matters
This commit is a routine CI (continuous integration) maintenance change. It lets the project's automated Python test runner download older Python versions when needed, specifically so tests can run against Python 3.14. It does not change any wallet, firmware, or cryptographic code and does not fix a security vulnerability.
No security action required; this is a CI configuration update.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change modifies three build/CI files. In shell.nix it adds a new pythonTest flag; when enabled, UV_PYTHON_PREFERENCE is set to managed and UV_PYTHON_DOWNLOADS to automatic, allowing uv to fetch Python interpreters. The default remains only-system/never. The GitHub workflow passes --arg pythonTest true for the python_test job, and python/tox.ini adds py314 to the test matrix. No product code is touched.
Changed components
.github/workflows/common.ymlpython/tox.inishell.nixInspect captured patch +17 / −12
diff --git a/.github/workflows/common.yml b/.github/workflows/common.yml
index a39d06a9..15e006ea 100644
--- a/.github/workflows/common.yml
+++ b/.github/workflows/common.yml
@@ -78,7 +78,7 @@ jobs:
submodules: recursive
- uses: ./.github/actions/environment
# LD_LIBRARY_PATH workaround: https://discourse.nixos.org/t/nixpkgs-nixos-unstable-many-package-fail-with-glibc-2-38-not-found/35078 https://github.com/NixOS/nixpkgs/issues/287764
- - run: nix-shell --run "unset LD_LIBRARY_PATH && cd python && uv run tox"
+ - run: nix-shell --arg pythonTest true --run "unset LD_LIBRARY_PATH && cd python && uv run tox"
rust_test:
name: Rust crates test
diff --git a/python/tox.ini b/python/tox.ini
index 44eb918e..4cea0e1c 100644
--- a/python/tox.ini
+++ b/python/tox.ini
@@ -1,8 +1,8 @@
[tox]
envlist =
- py{39,310,311,312,313}-{minimal,default,full}
- py{39,310,311,312,313}-click8{0,1}
- py{310,311,312,313}-click82
+ py{39,310,311,312,313,314}-{minimal,default,full}
+ py{39,310,311,312,313,314}-click8{0,1}
+ py{310,311,312,313,314}-click82
[testenv]
runner = uv-venv-runner
@@ -18,7 +18,7 @@ commands =
# Run test suite
!minimal: pytest -c setup.cfg --random-order tests
-[testenv:py{39,310,311,312,313}-click{80,81,82}]
+[testenv:py{39,310,311,312,313,314}-click{80,81,82}]
commands =
click80: uv pip install "click>=8.0,<8.1"
click81: uv pip install "click>=8.1,<8.2"
diff --git a/shell.nix b/shell.nix
index cf4e0400..cb786523 100644
--- a/shell.nix
+++ b/shell.nix
@@ -1,6 +1,7 @@
{ fullDeps ? false
, hardwareTest ? false
, devTools ? false
+, pythonTest ? false
}:
let
@@ -146,12 +147,6 @@ stdenvNoCC.mkDerivation ({
DYLD_LIBRARY_PATH = "${libffi}/lib:${libjpeg.out}/lib:${libusb1}/lib:${libressl.out}/lib";
NIX_ENFORCE_PURITY = 0;
- # Force uv to use the nix-provided Python instead of its own managed builds.
- # Without this, uv defaults to python-preference=managed + python-downloads=automatic,
- # silently downloading/reusing its own interpreter and ignoring python3 on PATH.
- UV_PYTHON_PREFERENCE = "only-system";
- UV_PYTHON_DOWNLOADS = "never";
-
# Fix bdist-wheel problem by setting source date epoch to a more recent date
SOURCE_DATE_EPOCH = 1600000000;
@@ -167,6 +162,16 @@ stdenvNoCC.mkDerivation ({
# Avoid printing "Using udevCheckHook", there are no rules to check
dontUdevCheck = 1;
-} // (lib.optionalAttrs fullDeps) {
+} // (if pythonTest then {
+ # Allow uv to use any python version for python tests
+ UV_PYTHON_PREFERENCE = "managed";
+ UV_PYTHON_DOWNLOADS = "automatic";
+} else {
+ # Force uv to use the nix-provided Python instead of its own managed builds.
+ # Without this, uv defaults to python-preference=managed + python-downloads=automatic,
+ # silently downloading/reusing its own interpreter and ignoring python3 on PATH.
+ UV_PYTHON_PREFERENCE = "only-system";
+ UV_PYTHON_DOWNLOADS = "never";
+}) // (lib.optionalAttrs fullDeps) {
TREZOR_MONERO_TESTS_PATH = moneroTestsPatched;
})
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.