python312Packages.insightface: disable tests on aarch64 (#351917)

* python312Packages.insightface: enable package for aarch64-linux

* python312Packages.insightface: disable passhtru tests for aarch64

* python312Packages.insightface: refactor
This commit is contained in:
Pablo Fraile Alonso 2024-10-29 14:29:54 +01:00 committed by GitHub
parent 6a1c602a16
commit 213114ad23
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 19 additions and 10 deletions

View File

@ -4,6 +4,7 @@
immich,
python3,
nixosTests,
stdenv,
}:
let
python = python3.override {
@ -58,6 +59,10 @@ python.pkgs.buildPythonApplication rec {
]
++ uvicorn.optional-dependencies.standard;
# aarch64-linux tries to get cpu information from /sys, which isn't available
# inside the nix build sandbox.
doCheck = stdenv.buildPlatform.system != "aarch64-linux";
nativeCheckInputs = with python.pkgs; [
httpx
pytest-asyncio

View File

@ -58,20 +58,26 @@ buildPythonPackage rec {
tqdm
];
# aarch64-linux tries to get cpu information from /sys, which isn't available
# inside the nix build sandbox.
dontUsePythonImportsCheck = stdenv.buildPlatform.system == "aarch64-linux";
passthru.tests = lib.optionalAttrs (stdenv.buildPlatform.system != "aarch64-linux") {
version = testers.testVersion {
package = insightface;
command = "insightface-cli --help";
# Doesn't support --version but we still want to make sure the cli is executable
# and returns the help output
version = "help";
};
};
pythonImportsCheck = [
"insightface"
"insightface.app"
"insightface.data"
];
passthru.tests.version = testers.testVersion {
package = insightface;
command = "insightface-cli --help";
# Doesn't support --version but we still want to make sure the cli is executable
# and returns the help output
version = "help";
};
doCheck = false; # Upstream has no tests
meta = {
@ -80,7 +86,5 @@ buildPythonPackage rec {
homepage = "https://github.com/deepinsight/insightface";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ oddlama ];
# terminate called after throwing an instance of 'onnxruntime::OnnxRuntimeException'
broken = stdenv.system == "aarch64-linux";
};
}