Unverified Commit 213114ad authored by Pablo Fraile Alonso's avatar Pablo Fraile Alonso Committed by GitHub
Browse files

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

* python312Packages.insightface: enable package for aarch64-linux

* python312Packages.insightface: disable passhtru tests for aarch64

* python312Packages.insightface: refactor
parent 6a1c602a
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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
+14 −10
Original line number Diff line number Diff line
@@ -58,19 +58,25 @@ buildPythonPackage rec {
    tqdm
  ];

  pythonImportsCheck = [
    "insightface"
    "insightface.app"
    "insightface.data"
  ];
  # 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.version = testers.testVersion {
  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"
  ];

  doCheck = false; # Upstream has no tests

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