From 8cffeac108fe8a4cf35f34dd9029679db6d15240 Mon Sep 17 00:00:00 2001 From: jopejoe1 Date: Mon, 13 Oct 2025 19:39:20 +0200 Subject: [PATCH 1/3] python3Packages.scancode-toolkit: make use of writableTmpDirAsHomeHook --- .../python-modules/scancode-toolkit/default.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/scancode-toolkit/default.nix b/pkgs/development/python-modules/scancode-toolkit/default.nix index bd89b5a31047..089c4af137e1 100644 --- a/pkgs/development/python-modules/scancode-toolkit/default.nix +++ b/pkgs/development/python-modules/scancode-toolkit/default.nix @@ -55,6 +55,7 @@ typecode, typecode-libmagic, urlpy, + writableTmpDirAsHomeHook, xmltodict, zipp, }: @@ -130,12 +131,13 @@ buildPythonPackage rec { ] ++ lib.optionals (pythonOlder "3.9") [ zipp ]; + nativeBuildInputs = [ + writableTmpDirAsHomeHook + ]; + nativeCheckInputs = [ pytestCheckHook ]; - # Importing scancode needs a writeable home, and preCheck happens in between - # pythonImportsCheckPhase and pytestCheckPhase. postInstall = '' - export HOME=$(mktemp -d) ''; pythonImportsCheck = [ "scancode" ]; From 9b60b131514809822a64279e7f0abd6b7a93e27f Mon Sep 17 00:00:00 2001 From: jopejoe1 Date: Mon, 13 Oct 2025 19:39:52 +0200 Subject: [PATCH 2/3] python3Packages.scancode-toolkit: pre-generate index file this is needed to run the scancode cli to scan a codebase otherwise it complains about a non-writable file. --- pkgs/development/python-modules/scancode-toolkit/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/python-modules/scancode-toolkit/default.nix b/pkgs/development/python-modules/scancode-toolkit/default.nix index 089c4af137e1..26280e0a3d70 100644 --- a/pkgs/development/python-modules/scancode-toolkit/default.nix +++ b/pkgs/development/python-modules/scancode-toolkit/default.nix @@ -137,7 +137,9 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook ]; + # Pre-genrating license index postInstall = '' + $out/bin/scancode-reindex-licenses ''; pythonImportsCheck = [ "scancode" ]; From 869c176220a1dcc639c1e7fe6cbb5863acd8e844 Mon Sep 17 00:00:00 2001 From: jopejoe1 Date: Mon, 13 Oct 2025 19:40:06 +0200 Subject: [PATCH 3/3] python3Packages.scancode-toolkit: renable tests --- .../development/python-modules/scancode-toolkit/default.nix | 6 ------ 1 file changed, 6 deletions(-) diff --git a/pkgs/development/python-modules/scancode-toolkit/default.nix b/pkgs/development/python-modules/scancode-toolkit/default.nix index 26280e0a3d70..42fd4f6c258d 100644 --- a/pkgs/development/python-modules/scancode-toolkit/default.nix +++ b/pkgs/development/python-modules/scancode-toolkit/default.nix @@ -144,12 +144,6 @@ buildPythonPackage rec { pythonImportsCheck = [ "scancode" ]; - disabledTestPaths = [ - # Tests are outdated - "src/formattedcode/output_spdx.py" - "src/scancode/cli.py" - ]; - # Takes a long time and doesn't appear to do anything dontStrip = true;