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 { };