python3Packages.rapidocr-onnruntime: disable checks on aarch64-linux

This commit is contained in:
Gaetan Lepage
2026-01-26 15:28:26 +00:00
parent 7c400364c0
commit aecf396c4c
@@ -1,5 +1,6 @@
{
lib,
stdenv,
config,
buildPythonPackage,
fetchFromGitHub,
@@ -32,6 +33,8 @@ let
stripRoot = false;
}
+ "/required_for_whl_v1.3.0/resources/models";
isNotAarch64Linux = !(stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64);
in
buildPythonPackage (finalAttrs: {
pname = "rapidocr-onnxruntime";
@@ -99,7 +102,13 @@ buildPythonPackage (finalAttrs: {
tqdm
];
pythonImportsCheck = [ "rapidocr_onnxruntime" ];
# aarch64-linux fails cpuinfo test, because /sys/devices/system/cpu/ does not exist in the sandbox:
# terminate called after throwing an instance of 'onnxruntime::OnnxRuntimeException'
#
# -> Skip all tests that require importing markitdown
pythonImportsCheck = lib.optionals isNotAarch64Linux [
"rapidocr_onnxruntime"
];
nativeCheckInputs = [
pytestCheckHook
@@ -117,10 +126,14 @@ buildPythonPackage (finalAttrs: {
"test_long_img"
];
# Tests require access to a physical GPU to work, otherwise the interpreter crashes:
# Fatal Python error: Aborted
# File "/nix/store/..onnxruntime/capi/onnxruntime_inference_collection.py", line 561 in _create_inference_session
doCheck = !cudaSupport;
doCheck =
# Tests require access to a physical GPU to work, otherwise the interpreter crashes:
# Fatal Python error: Aborted
# File "/nix/store/..onnxruntime/capi/onnxruntime_inference_collection.py", line 561 in _create_inference_session
(!cudaSupport)
# See comment above
# 'onnxruntime::OnnxRuntimeException'
&& isNotAarch64Linux;
# rapidocr-onnxruntime has been renamed to rapidocr by upstream since 2.0.0. However, some packages like open-webui still requires rapidocr-onnxruntime 1.4.4. Therefore we set no auto update here.
# nixpkgs-update: no auto update