From 0a3bb9598dfbd6720055643611f7411cdce95ea9 Mon Sep 17 00:00:00 2001 From: Leon Schuermann Date: Thu, 5 Jun 2025 13:23:10 -0400 Subject: [PATCH 1/4] default.nix: use pyproject for building Tockloader --- default.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/default.nix b/default.nix index 4565454..656222c 100644 --- a/default.nix +++ b/default.nix @@ -79,6 +79,12 @@ in pkgs.python3Packages.buildPythonPackage rec { in elemAt (match pattern (readFile ./tockloader/_version.py)) 0; name = "${pname}-${version}"; + pyproject = true; + + nativeBuildInputs = with python3Packages; [ + flit + ]; + propagatedBuildInputs = with python3Packages; [ argcomplete colorama From e74ae40cfaee37bd40690a473dcec8eebbbe9d9f Mon Sep 17 00:00:00 2001 From: Leon Schuermann Date: Thu, 5 Jun 2025 13:23:27 -0400 Subject: [PATCH 2/4] pyproject.toml: make pynrfjprog dependency spec less strict --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 8fe704d..38ad408 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,7 +16,7 @@ dependencies = [ "crcmod >= 1.7", "ecdsa >= 0.19.1", "pycryptodome >= 3.15.0", - "pynrfjprog == 10.19.0", + "pynrfjprog >= 10.19.0", "pyserial >= 3.0.1", "siphash >= 0.0.1", "six >= 1.9.0", From f2df5a663b8d8b9d57563d5cb7f3572ab2f773d9 Mon Sep 17 00:00:00 2001 From: Leon Schuermann Date: Thu, 5 Jun 2025 13:22:49 -0400 Subject: [PATCH 3/4] pyproject.toml: make pynrfjprog an optional dependencies --- pyproject.toml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 38ad408..0a27d33 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,7 +16,6 @@ dependencies = [ "crcmod >= 1.7", "ecdsa >= 0.19.1", "pycryptodome >= 3.15.0", - "pynrfjprog >= 10.19.0", "pyserial >= 3.0.1", "siphash >= 0.0.1", "six >= 1.9.0", @@ -25,6 +24,11 @@ dependencies = [ "questionary >= 1.10.0", ] +[project.optional-dependencies] +nrfjprog = [ + "pynrfjprog >= 10.19.0", +] + [project.urls] Home = "https://github.com/tock/tockloader" From a9fb8291086ff17f82e608c51782d968e9b0da57 Mon Sep 17 00:00:00 2001 From: Amit Aryeh Levy Date: Fri, 27 Jun 2025 21:54:31 -0700 Subject: [PATCH 4/4] default.nix: make pynrfjprog and nrf-cmd optional --- default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/default.nix b/default.nix index 656222c..ba880e0 100644 --- a/default.nix +++ b/default.nix @@ -104,8 +104,8 @@ in pkgs.python3Packages.buildPythonPackage rec { doCheck = withUnfreePkgs; # Make other dependencies explicitly available as passthru attributes - passthru = { + passthru = if withUnfreePkgs then { inherit nrf-command-line-tools; pynrfjprog = python3Packages.pynrfjprog; - }; + } else { }; }