From bb8b3fa5f27b88662b2535348864c9edd45bdefc Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Wed, 8 Apr 2026 05:57:43 +0000 Subject: [PATCH] python3Packages.mmengine: add missing test dependency, skip failing tests --- .../python-modules/mmengine/default.nix | 29 +++++++++++++++---- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/pkgs/development/python-modules/mmengine/default.nix b/pkgs/development/python-modules/mmengine/default.nix index aa4907f3482d..dcede7e2c76c 100644 --- a/pkgs/development/python-modules/mmengine/default.nix +++ b/pkgs/development/python-modules/mmengine/default.nix @@ -27,11 +27,12 @@ mlflow, parameterized, pytestCheckHook, + torchvision, transformers, writableTmpDirAsHomeHook, }: -buildPythonPackage rec { +buildPythonPackage (finalAttrs: { pname = "mmengine"; version = "0.10.7"; pyproject = true; @@ -39,7 +40,7 @@ buildPythonPackage rec { src = fetchFromGitHub { owner = "open-mmlab"; repo = "mmengine"; - tag = "v${version}"; + tag = "v${finalAttrs.version}"; hash = "sha256-hQnwenuxHQwl+DwQXbIfsKlJkmcRvcHV1roK7q2X1KA="; }; @@ -63,7 +64,7 @@ buildPythonPackage rec { substituteInPlace setup.py \ --replace-fail \ "return locals()['__version__']" \ - "return '${version}'" + "return '${finalAttrs.version}'" '' + '' substituteInPlace tests/test_config/test_lazy.py \ @@ -94,6 +95,7 @@ buildPythonPackage rec { mlflow parameterized pytestCheckHook + torchvision transformers writableTmpDirAsHomeHook ]; @@ -172,6 +174,23 @@ buildPythonPackage rec { # AssertionError: os is not "test_lazy_module" ] + ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [ + # RuntimeError: Failed to initialize cpuinfo! + "test_to_device_and_dtype_00_cpu" + "test_to_device_and_dtype_01_cpu" + "test_to_device_and_dtype_02_cpu" + "test_to_device_and_dtype_09_cpu" + "test_to_device_and_dtype_10_cpu" + "test_to_device_and_dtype_11_cpu" + "test_to_device_and_dtype_12" + "test_to_device_and_dtype_13" + "test_to_device_and_dtype_14" + "test_to_device_and_dtype_21" + "test_to_device_and_dtype_22" + "test_to_device_and_dtype_23" + "test_to_dtype_0" + "test_to_dtype_3" + ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ # Fails when max-jobs is set to use fewer processes than cores # for example `AssertionError: assert 14 == 4` @@ -184,8 +203,8 @@ buildPythonPackage rec { meta = { description = "Library for training deep learning models based on PyTorch"; homepage = "https://github.com/open-mmlab/mmengine"; - changelog = "https://github.com/open-mmlab/mmengine/releases/tag/v${version}"; + changelog = "https://github.com/open-mmlab/mmengine/releases/tag/${finalAttrs.src.tag}"; license = with lib.licenses; [ asl20 ]; maintainers = with lib.maintainers; [ rxiao ]; }; -} +})