From 6a3317579da615bc7bbd8b33ce6db3fd1197499e Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Thu, 13 Feb 2025 01:19:24 +0100 Subject: [PATCH] python312Packages.kserve: fix on darwin and linux --- .../python-modules/kserve/default.nix | 40 +++++++++++++++---- 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/pkgs/development/python-modules/kserve/default.nix b/pkgs/development/python-modules/kserve/default.nix index 2fc4813f1a7a..20ed84acdf57 100644 --- a/pkgs/development/python-modules/kserve/default.nix +++ b/pkgs/development/python-modules/kserve/default.nix @@ -1,5 +1,6 @@ { lib, + stdenv, buildPythonPackage, fetchFromGitHub, @@ -121,19 +122,44 @@ buildPythonPackage rec { pythonImportsCheck = [ "kserve" ]; + pytestFlagsArray = + [ + # AssertionError + "--deselect=test/test_server.py::TestTFHttpServerLoadAndUnLoad::test_unload" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # RuntimeError: Failed to start GCS + "--deselect=test/test_dataplane.py::TestDataPlane::test_explain" + "--deselect=test/test_dataplane.py::TestDataPlane::test_infer" + "--deselect=test/test_dataplane.py::TestDataPlane::test_model_metadata" + "--deselect=test/test_dataplane.py::TestDataPlane::test_server_readiness" + "--deselect=test/test_server.py::TestRayServer::test_explain" + "--deselect=test/test_server.py::TestRayServer::test_health_handler" + "--deselect=test/test_server.py::TestRayServer::test_infer" + "--deselect=test/test_server.py::TestRayServer::test_list_handler" + "--deselect=test/test_server.py::TestRayServer::test_liveness_handler" + "--deselect=test/test_server.py::TestRayServer::test_predict" + ]; + disabledTestPaths = [ # Looks for a config file at the root of the repository "test/test_inference_service_client.py" ]; - disabledTests = [ - # Require network access - "test_infer_graph_endpoint" - "test_infer_path_based_routing" + disabledTests = + [ + # Require network access + "test_infer_graph_endpoint" + "test_infer_path_based_routing" - # Tries to access `/tmp` (hardcoded) - "test_local_path_with_out_dir_exist" - ]; + # Tries to access `/tmp` (hardcoded) + "test_local_path_with_out_dir_exist" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "test_local_path_with_out_dir_not_exist" + ]; + + __darwinAllowLocalNetworking = true; meta = { description = "Standardized Serverless ML Inference Platform on Kubernetes";