Add a runtime test for fastapi. Use uvicorn as the asgi server application as does the fastapi hello world example [1]. Fastapi depends on PydanticV2 now which is written in rust so we need to run the test on armv7. [1] https://fastapi.tiangolo.com/tutorial/first-steps/ Signed-off-by: Marcus Hoffmann <bubu@bubu1.eu> [Arnout: - fix flake8 errors support/testing/tests/package/sample_python_fastapi.py:5:1: E302 expected 2 blank lines, found 1 support/testing/tests/package/sample_python_fastapi.py:8:1: W391 blank line at end of file - Remove BR2_CCACHE (as requested by Marcus). - Add a comment explaining that this also tests uvicorn and pydantic. - Re-try wget in a loop instead of a fixed timeout of 30 seconds. - Add a DEVELOPERS entry. ] Signed-off-by: Arnout Vandecappelle <arnout@mind.be>
9 lines
117 B
Python
9 lines
117 B
Python
from fastapi import FastAPI
|
|
|
|
app = FastAPI()
|
|
|
|
|
|
@app.get("/")
|
|
async def root():
|
|
return {"message": "Hello World"}
|