From 05ae75ce8df7d3e7071c5f53b85028ad798b6203 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Sat, 25 Oct 2025 22:12:02 +0200 Subject: [PATCH] python3Packages.trezor: 0.13.10 -> 0.20.0 --- .../python-modules/trezor/default.nix | 46 +++++++++++++------ pkgs/top-level/all-packages.nix | 8 +++- 2 files changed, 40 insertions(+), 14 deletions(-) diff --git a/pkgs/development/python-modules/trezor/default.nix b/pkgs/development/python-modules/trezor/default.nix index daaf959139f8..6b124472de72 100644 --- a/pkgs/development/python-modules/trezor/default.nix +++ b/pkgs/development/python-modules/trezor/default.nix @@ -3,53 +3,73 @@ lib, buildPythonPackage, fetchPypi, + hatchling, + pytestCheckHook, + pytest-random-order, + # dependencies click, construct, construct-classes, cryptography, - ecdsa, + keyring, libusb1, mnemonic, + noiseprotocol, + platformdirs, requests, - setuptools, shamir-mnemonic, slip10, typing-extensions, - trezor-udev-rules, - pytestCheckHook, + # optional-dependencies + bleak, + pillow, + hidapi, + web3, + pyqt5, }: buildPythonPackage rec { pname = "trezor"; - version = "0.13.10"; + version = "0.20.0"; pyproject = true; src = fetchPypi { inherit pname version; - hash = "sha256-egtq5GKN0MMaXOtRJYkY2bvdOthROIg3IlgmsijuUE8="; + hash = "sha256-TAmOIDFbJxZnOr3vQCgi5xiRAVmMfAPyN0ndIBDuJQQ="; }; - build-system = [ setuptools ]; + build-system = [ hatchling ]; dependencies = [ click construct construct-classes cryptography - ecdsa + keyring libusb1 mnemonic + noiseprotocol + platformdirs requests shamir-mnemonic slip10 typing-extensions - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ trezor-udev-rules ]; + ]; - # fix "click<8.2,>=7 not satisfied by version 8.3.1" - pythonRelaxDeps = [ "click" ]; + optional-dependencies = { + ble = [ bleak ]; + extra = [ pillow ]; + hidapi = [ hidapi ]; + ethereum = [ web3 ]; + qt-widgets = [ pyqt5 ]; + # stellar = [ stellar-sdk ]; # missing in nixpkgs + full = lib.flatten (lib.attrValues (lib.removeAttrs optional-dependencies [ "full" ])); + }; - nativeCheckInputs = [ pytestCheckHook ]; + nativeCheckInputs = [ + pytestCheckHook + pytest-random-order + ]; disabledTestPaths = [ "tests/test_stellar.py" # requires stellar-sdk diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 02cfd9bc8bbc..29e3cd02d8ba 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3575,7 +3575,13 @@ with pkgs; trackma-qt = trackma.override { withQT = true; }; - trezorctl = with python3Packages; toPythonApplication trezor; + trezorctl = + with python3Packages; + toPythonApplication ( + trezor.overridePythonAttrs (oldAttrs: { + dependencies = oldAttrs.dependencies ++ oldAttrs.optional-dependencies.full; + }) + ); trezor-agent = with python3Packages; toPythonApplication trezor-agent;