From 1301e4f0b024dfe7f11b921c798a35dab2d339d5 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Fri, 1 Nov 2024 10:07:28 +0000 Subject: [PATCH] pyamlboot.tests: fix the eval MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Without the change the eval fails as: $ nix build --no-link -f. pyamlboot.tests error: … while evaluating the attribute 'version' at pkgs/by-name/py/pyamlboot/package.nix:29:3: 28| 29| passthru.tests.version = testers.testVersion { | ^ 30| package = "pyamlboot"; … while evaluating the 'name' attribute of a derivation … while evaluating a branch condition at lib/strings.nix:2627:3: 2626| # First detect the common case of already valid strings, to speed those up 2627| if stringLength string <= 207 && okRegex string != null | ^ 2628| then unsafeDiscardStringContext string (stack trace truncated; use '--show-trace' to show the full, detailed trace) error: expected a set but found a string: "pyamlboot" After fixing the eval tests started failing as `--version` hardcodes 1.0. Co-authored-by: Nick Cao --- pkgs/by-name/py/pyamlboot/package.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/py/pyamlboot/package.nix b/pkgs/by-name/py/pyamlboot/package.nix index 6606fee6d187..82fe116dc133 100644 --- a/pkgs/by-name/py/pyamlboot/package.nix +++ b/pkgs/by-name/py/pyamlboot/package.nix @@ -3,6 +3,7 @@ fetchFromGitHub, python3Packages, testers, + pyamlboot, }: python3Packages.buildPythonApplication rec { @@ -27,9 +28,9 @@ python3Packages.buildPythonApplication rec { ]; passthru.tests.version = testers.testVersion { - package = "pyamlboot"; + package = pyamlboot; command = "boot.py -v"; - version = "boot.py ${version}"; + version = "boot.py ${lib.versions.majorMinor version}"; }; meta = {