From c9bf05799f69d96efd95ab44d82c3d0354b94e34 Mon Sep 17 00:00:00 2001 From: Ben Hamm Date: Thu, 5 Nov 2026 15:37:17 -0800 Subject: [PATCH] test(replay): detect AISimulate under the aisim distribution name AISimulate 0.14.0 ships as the `aisim` distribution (the import name is still `aisimulate`), and release/1.7.0 pins `aisim==0.14.0`. The replay integration gate in tests/replay/replay_utils.py only looked up `distribution("aisimulate")`, so with `aisim` installed it raised PackageNotFoundError and skipped: test_replay_planner_scaling.py was skipped at module level and test_replay_smoke.py::test_planner_replay_accepts_multi_shard_dynamo_trace skipped in its body, with no failure to flag the lost coverage. Accept either distribution name, `aisim` first and then `aisimulate`, so the gate works on main (still pinned to `aisimulate==0.13.0.dev...`) and on branches that pin `aisim`. The tests still skip when neither is installed, and the skip reason now names both distributions. Internal tracking: Linear AISIM-2278. Co-Authored-By: Claude Opus 5.5 Signed-off-by: Ben Hamm (cherry picked from commit 45de8971909f2a201f7a2a5412be1de00cc40f93) --- .../python/tests/replay/replay_utils.py | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/lib/bindings/python/tests/replay/replay_utils.py b/lib/bindings/python/tests/replay/replay_utils.py index ce690da35553..052950a073fa 100644 --- a/lib/bindings/python/tests/replay/replay_utils.py +++ b/lib/bindings/python/tests/replay/replay_utils.py @@ -37,14 +37,23 @@ """ +# AISimulate ships as the ``aisim`` distribution from 0.14.0 onward; earlier +# releases used ``aisimulate``. The import name is ``aisimulate`` for both. +_AISIMULATE_DISTRIBUTIONS = ("aisim", "aisimulate") + + def _require_aisimulate_distribution(*, allow_module_level: bool = False) -> None: - try: - distribution("aisimulate") - except PackageNotFoundError: - pytest.skip( - "Dynamo replay integration tests require the optional AISimulate distribution", - allow_module_level=allow_module_level, - ) + for name in _AISIMULATE_DISTRIBUTIONS: + try: + distribution(name) + return + except PackageNotFoundError: + continue + pytest.skip( + "Dynamo replay integration tests require the optional AISimulate " + f"distribution (one of {', '.join(_AISIMULATE_DISTRIBUTIONS)})", + allow_module_level=allow_module_level, + ) def _vllm_args_payload():