stable

python-fastapi-0.84.0-3.fc37

FEDORA-2022-561fbfdbf7 created by music a year ago for Fedora 37

Initial (unretired) package for Fedora 37

How to install

Updates may require up to 24 hours to propagate to mirrors. If the following command doesn't work, please retry later:

sudo dnf install --refresh --advisory=FEDORA-2022-561fbfdbf7 \*

This update has been submitted for testing by music.

a year ago

This update's test gating status has been changed to 'ignored'.

a year ago

This update has been pushed to testing.

a year ago
User Icon lionbee commented & provided feedback a year ago
karma

Tested basic service with auth and GET and POST

User Icon tritas commented & provided feedback a year ago
karma

Simple web app is functional

This update can be pushed to stable now if the maintainer wishes

a year ago
User Icon derrix commented & provided feedback a year ago
karma

Tested https://fastapi.tiangolo.com/tutorial/body-nested-models/#use-the-submodel-as-a-type

Basically a simple PUT and GET.

How it was tested:

  • Created a Fedora:37 docker container
  • sudo dnf install --enablerepo=updates-testing --refresh --advisory=FEDORA-2022-561fbfdbf7 python-fastapi
  • sudo dnf install pip
  • pip install uvicorn
  • created a main.py file
from fastapi import FastAPI
from pydantic import BaseModel

app = FastAPI()


class Image(BaseModel):
    url: str
    name: str


class Item(BaseModel):
    name: str
    description: str | None = None
    price: float
    tax: float | None = None
    tags: set[str] = set()
    image: Image | None = None

RESULTS: dict[int, Item] = {}

@app.put("/items/{item_id}")
async def update_item(item_id: int, item: Item):
    RESULTS[item_id] = item
    results = {"item_id": item_id, "item": item}
    return results

@app.get("/items/{item_id}")
async def get_item(item_id: int):
    return RESULTS[item_id]
  • uvicorn main:app --reload &
  • curl -X PUT http://127.0.0.1:8000/items/1 -d '{ "name": "Foo", "description": "The pretender", "price": 42.0, "tax": 3.2, "tags": ["rock", "metal", "bar"], "image": { "url": "http://example.com/baz.jpg", "name": "The Foo alive" }}' -H 'Content-Type: application/json'
  • curl http://127.0.0.1:8000/items/1
  • curl -X PUT http://127.0.0.1:8000/items/1 -d '{ "name": "Foo", "description": "something else", "price": 99.0, "tax": 0.0, "tags": ["pop"], "image": { "url": "http://example.com/foo.jpg", "name": "The Bar alive" }}' -H 'Content-Type: application/json'
  • curl http://127.0.0.1:8000/items/1 (and checked that the contents changed)

Also checked the docs http://127.0.0.1:8000/docs and it looked okay.

This update has been submitted for stable by bodhi.

a year ago
User Icon derrix commented & provided feedback a year ago
python3
Python 3.11.0 (main, Oct 24 2022, 00:00:00) [GCC 12.2.1 20220819 (Red Hat 12.2.1-2)] on linux>>> import uvicorn; uvicorn.__version__
'0.20.0'
>>> import fastapi; fastapi.__version__
'0.84.0'

This update has been pushed to stable.

a year ago

Please login to add feedback.

Metadata
Type
newpackage
Karma
3
Signed
Content Type
RPM
Test Gating
Settings
Unstable by Karma
-3
Stable by Karma
3
Stable by Time
7 days
Dates
submitted
a year ago
in testing
a year ago
in stable
a year ago
BZ#2098906 F37FailsToInstall: python3-fastapi+all, python3-fastapi
0
0
BZ#2113625 python-fastapi: FTBFS in Fedora rawhide/f37
0
0
BZ#2143072 Please branch and build python-fastapi for f37
0
0

Automated Test Results