Daniel Alejandro Mesejo-Le贸n
03/11/2023, 6:46 PMpytest tests
I get:
ImportError while loading conftest '/Users/daniel.mesejo/PycharmProjects/prefect/tests/conftest.py'.
tests/conftest.py:67: in <module>
from prefect.testing.cli import *
src/prefect/testing/cli.py:7: in <module>
from prefect.cli import app
src/prefect/cli/__init__.py:9: in <module>
import prefect.cli.cloud
src/prefect/cli/cloud.py:58: in <module>
login_api = FastAPI(on_startup=[set_login_api_ready_event])
../../opt/anaconda3/envs/prefect/lib/python3.8/site-packages/fastapi/applications.py:124: in __init__
self.router: routing.APIRouter = routing.APIRouter(
../../opt/anaconda3/envs/prefect/lib/python3.8/site-packages/fastapi/routing.py:502: in __init__
super().__init__(
../../opt/anaconda3/envs/prefect/lib/python3.8/site-packages/starlette/routing.py:592: in __init__
warnings.warn(
E DeprecationWarning: The on_startup and on_shutdown parameters are deprecated, and they will be removed on version 1.0. Use the lifespan parameter instead. See more about it on <https://www.starlette.io/lifespan/>.
This is because the latest version (0.94.0) of FastAPI uses the version 0.26.0.post1 of starlette, that it turn introduces the DeprecationWarning
. The last update for FastAPI was done yesterday March 10th (see here).
In the short term downgrading to 0.93.0 (pip install fastapi==0.93.0
) solves the issue, but perhaps for the future is worth creating a ticket to start using the lifespan parameter. What would be the best course of action here? In any case I鈥檒l be happy to help 馃檪.Zanie
Zanie
Zanie
Zanie
main
is failingZanie
Zanie
Daniel Alejandro Mesejo-Le贸n
03/13/2023, 3:50 PMZanie