From 437ea5a6ec76ea38a1af471317d311544cd22907 Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Mon, 3 Aug 2026 23:20:34 +0200 Subject: [PATCH] python3Packages.granian: run pytest in passthru.tests It's too unstable for hydra, but it is nice to have during bumps. --- .../python-modules/granian/default.nix | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/granian/default.nix b/pkgs/development/python-modules/granian/default.nix index c785701b3380..6edbe1054e03 100644 --- a/pkgs/development/python-modules/granian/default.nix +++ b/pkgs/development/python-modules/granian/default.nix @@ -4,6 +4,7 @@ rustPlatform, cacert, buildPythonPackage, + granian, uvloop, click, setproctitle, @@ -39,7 +40,8 @@ buildPythonPackage rec { ]; cargoDeps = rustPlatform.fetchCargoVendor { - inherit pname version src; + pname = "granian"; + inherit version src; hash = "sha256-IdvKvAFuE+GpnLknbVNUGEqAJghJc4sHuJkOL2tDHWI="; }; @@ -95,6 +97,27 @@ buildPythonPackage rec { # FIXME: root cause and fix this. doCheck = false; + # Make ofborg run checks. + # They're too buggy for hydra, but still a useful smell test + passthru.tests = { + # overridePythonAttrs is not available in finalAttrs.finalPackage + pytest = granian.overridePythonAttrs { + pname = "granian-with-check-phase"; + # skip repeat build + buildPhase = '' + # runHook preBuild + die() { echo >&2 "$@"; exit 1; } + [[ ! -d dist ]] || die "ERROR: dist/ found at start of buildPhase" + cp -r ${granian.dist} dist + chmod -R +w dist/ + runHook postBuild + ''; + nativeBuildInputs = [ ]; # maturin overwrites buildPhase unconditionally + doCheck = true; + dontCheckPythonMetadata = true; # changed pname + }; + }; + pythonImportsCheck = [ "granian" ]; passthru.updateScript = nix-update-script { };