You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Python - Lab Tests fails on every PR since fastapi was raised to 0.141. The failing step is Run resource-intensive lab tests:
cd packages/lab && uv run pytest -m "resource_intensive and not integration"
FAILED lightning/tests/test_lightning.py::test_observability - ImportError: cannot import name
'get_flat_dependant' from 'fastapi.dependencies.utils'
This is not specific to any one PR — it reproduces on the merge-queue run for an unrelated ag-ui change and on other open PRs.
Two things combine to produce the failure.
1. fastapi 0.141 no longer exposes get_flat_dependant, and litellm's proxy imports it. The import chain from the test is:
pytest.importorskip("agentlightning")
-> agentlightning/__init__.py:13 from .llm_proxy import *
-> agentlightning/llm_proxy.py:41 from litellm.proxy.proxy_server import app, save_worker_config
-> litellm/proxy/proxy_server.py:397
-> litellm/proxy/management_endpoints/management_v1/common.py:6
from fastapi.dependencies.utils import get_flat_dependant # ImportError
Resolved versions in python/uv.lock: fastapi 0.141.1, litellm 1.95.0, agentlightning 0.3.0.
#8052 raised the bound to fastapi>=0.121.0,<0.142.0, which allows 0.141. That was the right fix for #8042 (the previous <0.140.0 cap excluded every current release); the lab package's transitive litellm[proxy] just is not compatible with 0.141 yet.
2. The importorskip guard no longer skips, so it hard-fails.lightning/tests/test_lightning.py:129 is:
pytest.importorskip("agentlightning")
The repo pins pytest==9.1.1, whose importorskip defaults to exc_type=ModuleNotFoundError. agentlightningis installed, so the failure is a plain nested ImportError from a dependency — which propagates instead of being converted to a skip. The guard was presumably written expecting the older behaviour where any ImportError skipped.
So even once the version conflict is resolved, the guard as written will hard-fail the suite for any future broken transitive import rather than skipping the optional test.
Code Sample
cd python/packages/lab && uv run pytest -m "resource_intensive and not integration"
Error Messages / Stack Traces
lightning/tests/test_lightning.py:129: in test_observability
pytest.importorskip("agentlightning")
.venv/lib/python3.13/site-packages/agentlightning/__init__.py:13: in <module>
from .llm_proxy import *
.venv/lib/python3.13/site-packages/agentlightning/llm_proxy.py:41: in <module>
from litellm.proxy.proxy_server import app, save_worker_config
.venv/lib/python3.13/site-packages/litellm/proxy/proxy_server.py:397: in <module>
from litellm.proxy.management_endpoints.management_v1 import (
.venv/lib/python3.13/site-packages/litellm/proxy/management_endpoints/management_v1/common.py:6: in <module>
from fastapi.dependencies.utils import get_flat_dependant
E ImportError: cannot import name 'get_flat_dependant' from 'fastapi.dependencies.utils'
3.13 (observed on Python Lab Tests (3.13, ubuntu-latest)); the incompatibility is version-independent.
Additional Context
Possible directions, in rough order of how targeted they are — happy to send a PR for whichever you prefer, or to leave it entirely if this is already in hand:
Make the guard skip again: pytest.importorskip("agentlightning", exc_type=ImportError). Restores the test's intended optionality and stops an optional extra's transitive breakage from failing CI. Does not address the underlying incompatibility.
Constrain fastapi for the lab package only, so packages/lab resolves a fastapi that litellm's proxy supports, leaving the raised bound from Python: support current FastAPI releases #8052 in place for the shipped packages.
Wait for / require a litellm release compatible with fastapi 0.141 and bump the floor once one exists.
(1) and (2)/(3) are complementary rather than alternatives: (1) makes the suite honest about the test being optional, while (2)/(3) actually restore the coverage.
I have not opened a PR for this — flagging it first since #8052 is recent and you may already have a preferred direction.
Description
Python - Lab Testsfails on every PR since fastapi was raised to 0.141. The failing step isRun resource-intensive lab tests:This is not specific to any one PR — it reproduces on the merge-queue run for an unrelated ag-ui change and on other open PRs.
Two things combine to produce the failure.
1. fastapi 0.141 no longer exposes
get_flat_dependant, and litellm's proxy imports it. The import chain from the test is:Resolved versions in
python/uv.lock: fastapi0.141.1, litellm1.95.0, agentlightning0.3.0.#8052 raised the bound to
fastapi>=0.121.0,<0.142.0, which allows 0.141. That was the right fix for #8042 (the previous<0.140.0cap excluded every current release); the lab package's transitivelitellm[proxy]just is not compatible with 0.141 yet.2. The
importorskipguard no longer skips, so it hard-fails.lightning/tests/test_lightning.py:129is:The repo pins
pytest==9.1.1, whoseimportorskipdefaults toexc_type=ModuleNotFoundError.agentlightningis installed, so the failure is a plain nestedImportErrorfrom a dependency — which propagates instead of being converted to a skip. The guard was presumably written expecting the older behaviour where anyImportErrorskipped.So even once the version conflict is resolved, the guard as written will hard-fail the suite for any future broken transitive import rather than skipping the optional test.
Code Sample
Error Messages / Stack Traces
Package Versions
main@ 1f01b0d. fastapi 0.141.1, litellm 1.95.0, agentlightning 0.3.0, pytest 9.1.1.Python Version
3.13 (observed on
Python Lab Tests (3.13, ubuntu-latest)); the incompatibility is version-independent.Additional Context
Possible directions, in rough order of how targeted they are — happy to send a PR for whichever you prefer, or to leave it entirely if this is already in hand:
pytest.importorskip("agentlightning", exc_type=ImportError). Restores the test's intended optionality and stops an optional extra's transitive breakage from failing CI. Does not address the underlying incompatibility.packages/labresolves a fastapi that litellm's proxy supports, leaving the raised bound from Python: support current FastAPI releases #8052 in place for the shipped packages.(1) and (2)/(3) are complementary rather than alternatives: (1) makes the suite honest about the test being optional, while (2)/(3) actually restore the coverage.
I have not opened a PR for this — flagging it first since #8052 is recent and you may already have a preferred direction.