python: python3.10
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
- rev: v4.3.0
+ rev: v4.4.0
hooks:
- id: check-added-large-files
- id: check-toml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/asottile/pyupgrade
- rev: v3.2.2
+ rev: v3.3.1
hooks:
- id: pyupgrade
args:
- --py3-plus
- --keep-runtime-typing
- repo: https://github.com/charliermarsh/ruff-pre-commit
- rev: v0.0.138
+ rev: v0.0.254
hooks:
- id: ruff
args:
name: isort (pyi)
types: [pyi]
- repo: https://github.com/psf/black
- rev: 22.10.0
+ rev: 23.1.0
hooks:
- id: black
ci:
item: Item,
user: User,
importance: int = Body(gt=0),
- q: Union[str, None] = None
+ q: Union[str, None] = None,
):
results = {"item_id": item_id, "item": item, "user": user, "importance": importance}
if q:
item: Item,
user: User,
importance: int = Body(gt=0),
- q: str | None = None
+ q: str | None = None,
):
results = {"item_id": item_id, "item": item, "user": user, "importance": importance}
if q:
*,
item_id: int = Path(title="The ID of the item to get", ge=0, le=1000),
q: str,
- size: float = Query(gt=0, lt=10.5)
+ size: float = Query(gt=0, lt=10.5),
):
results = {"item_id": item_id}
if q:
fn: Callable[[], Coroutine[Any, Any, Any]]
) -> None:
result = await fn()
- results.append(result)
+ results.append(result) # noqa: B023
async with anyio.create_task_group() as tg:
for sub_value in value:
generate_unique_id
),
) -> Callable[[DecoratedCallable], DecoratedCallable]:
-
return self.api_route(
path=path,
response_model=response_model,
name: str,
scheme_name: Optional[str] = None,
description: Optional[str] = None,
- auto_error: bool = True
+ auto_error: bool = True,
):
self.model: APIKey = APIKey(
**{"in": APIKeyIn.query}, name=name, description=description
name: str,
scheme_name: Optional[str] = None,
description: Optional[str] = None,
- auto_error: bool = True
+ auto_error: bool = True,
):
self.model: APIKey = APIKey(
**{"in": APIKeyIn.header}, name=name, description=description
name: str,
scheme_name: Optional[str] = None,
description: Optional[str] = None,
- auto_error: bool = True
+ auto_error: bool = True,
):
self.model: APIKey = APIKey(
**{"in": APIKeyIn.cookie}, name=name, description=description
flows: Union[OAuthFlowsModel, Dict[str, Dict[str, Any]]] = OAuthFlowsModel(),
scheme_name: Optional[str] = None,
description: Optional[str] = None,
- auto_error: bool = True
+ auto_error: bool = True,
):
self.model = OAuth2Model(flows=flows, description=description)
self.scheme_name = scheme_name or self.__class__.__name__
openIdConnectUrl: str,
scheme_name: Optional[str] = None,
description: Optional[str] = None,
- auto_error: bool = True
+ auto_error: bool = True,
):
self.model = OpenIdConnectModel(
openIdConnectUrl=openIdConnectUrl, description=description
@pytest.fixture(name="client")
def get_client(app: FastAPI):
-
client = TestClient(app)
return client
@pytest.fixture(name="client")
def get_client(app: FastAPI):
-
client = TestClient(app)
return client