mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-10-02 04:50:21 +00:00
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:
@@ -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 { };
|
||||
|
||||
Reference in New Issue
Block a user