Skip to content

Commit

Permalink
python312Packages.kserve: fix on darwin (NixOS#381692)
Browse files Browse the repository at this point in the history
  • Loading branch information
NickCao authored Feb 13, 2025
2 parents 5769193 + ae077d0 commit a6e4772
Showing 1 changed file with 35 additions and 7 deletions.
42 changes: 35 additions & 7 deletions pkgs/development/python-modules/kserve/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildPythonPackage,
fetchFromGitHub,

Expand Down Expand Up @@ -43,6 +44,7 @@
avro,
grpcio-testing,
pytest-asyncio,
pytest-xdist,
pytestCheckHook,
tomlkit,
}:
Expand Down Expand Up @@ -115,25 +117,51 @@ buildPythonPackage rec {
avro
grpcio-testing
pytest-asyncio
pytest-xdist
pytestCheckHook
tomlkit
] ++ lib.flatten (builtins.attrValues optional-dependencies);

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"
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
"test_local_path_with_out_dir_not_exist"
];

# Tries to access `/tmp` (hardcoded)
"test_local_path_with_out_dir_exist"
];
__darwinAllowLocalNetworking = true;

meta = {
description = "Standardized Serverless ML Inference Platform on Kubernetes";
Expand Down

0 comments on commit a6e4772

Please sign in to comment.