python3Packages.granian: run pytest in passthru.tests

It's too unstable for hydra, but it is nice to have during bumps.
This commit is contained in:
Peder Bergebakken Sundt
2026-08-03 23:20:34 +02:00
parent bf24457d2b
commit 437ea5a6ec

View File

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