Skip to content

Commit

Permalink
python312Packages.insightface: disable tests on aarch64 (NixOS#351917)
Browse files Browse the repository at this point in the history
* python312Packages.insightface: enable package for aarch64-linux

* python312Packages.insightface: disable passhtru tests for aarch64

* python312Packages.insightface: refactor
  • Loading branch information
Pablito2020 authored Oct 29, 2024
1 parent 6a1c602 commit 213114a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
5 changes: 5 additions & 0 deletions pkgs/by-name/im/immich-machine-learning/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
immich,
python3,
nixosTests,
stdenv,
}:
let
python = python3.override {
Expand Down Expand Up @@ -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
Expand Down
24 changes: 14 additions & 10 deletions pkgs/development/python-modules/insightface/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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";
};
}

0 comments on commit 213114a

Please sign in to comment.