From 587ef297689baeb135f9e01af83b92a4a2885535 Mon Sep 17 00:00:00 2001 From: Pavel Ershov <40699895+PavelErsh@users.noreply.github.com> Date: Fri, 15 Mar 2024 21:02:37 +0200 Subject: [PATCH] black test --- async_api/poetry.lock | 51 ++++++++++++++++++++++++++++++++++- async_api/pyproject.toml | 2 ++ async_api/src/api/v1/films.py | 4 +-- 3 files changed, 54 insertions(+), 3 deletions(-) diff --git a/async_api/poetry.lock b/async_api/poetry.lock index c917906..b03feca 100644 --- a/async_api/poetry.lock +++ b/async_api/poetry.lock @@ -514,6 +514,22 @@ docs = ["furo (>=2023.9.10)", "sphinx (>=7.2.6)", "sphinx-autodoc-typehints (>=1 testing = ["covdefaults (>=2.3)", "coverage (>=7.3.2)", "diff-cover (>=8)", "pytest (>=7.4.3)", "pytest-cov (>=4.1)", "pytest-mock (>=3.12)", "pytest-timeout (>=2.2)"] typing = ["typing-extensions (>=4.8)"] +[[package]] +name = "flake8" +version = "7.0.0" +description = "the modular source code checker: pep8 pyflakes and co" +optional = false +python-versions = ">=3.8.1" +files = [ + {file = "flake8-7.0.0-py2.py3-none-any.whl", hash = "sha256:a6dfbb75e03252917f2473ea9653f7cd799c3064e54d4c8140044c5c065f53c3"}, + {file = "flake8-7.0.0.tar.gz", hash = "sha256:33f96621059e65eec474169085dc92bf26e7b2d47366b70be2f67ab80dc25132"}, +] + +[package.dependencies] +mccabe = ">=0.7.0,<0.8.0" +pycodestyle = ">=2.11.0,<2.12.0" +pyflakes = ">=3.2.0,<3.3.0" + [[package]] name = "frozenlist" version = "1.4.1" @@ -647,6 +663,17 @@ files = [ {file = "iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3"}, ] +[[package]] +name = "mccabe" +version = "0.7.0" +description = "McCabe checker, plugin for flake8" +optional = false +python-versions = ">=3.6" +files = [ + {file = "mccabe-0.7.0-py2.py3-none-any.whl", hash = "sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e"}, + {file = "mccabe-0.7.0.tar.gz", hash = "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325"}, +] + [[package]] name = "multidict" version = "6.0.5" @@ -887,6 +914,17 @@ nodeenv = ">=0.11.1" pyyaml = ">=5.1" virtualenv = ">=20.10.0" +[[package]] +name = "pycodestyle" +version = "2.11.1" +description = "Python style guide checker" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pycodestyle-2.11.1-py2.py3-none-any.whl", hash = "sha256:44fe31000b2d866f2e41841b18528a505fbd7fef9017b04eff4e2648a0fadc67"}, + {file = "pycodestyle-2.11.1.tar.gz", hash = "sha256:41ba0e7afc9752dfb53ced5489e89f8186be00e599e712660695b7a75ff2663f"}, +] + [[package]] name = "pydantic" version = "2.6.4" @@ -997,6 +1035,17 @@ files = [ [package.dependencies] typing-extensions = ">=4.6.0,<4.7.0 || >4.7.0" +[[package]] +name = "pyflakes" +version = "3.2.0" +description = "passive checker of Python programs" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pyflakes-3.2.0-py2.py3-none-any.whl", hash = "sha256:84b5be138a2dfbb40689ca07e2152deb896a65c3a3e24c251c5c62489568074a"}, + {file = "pyflakes-3.2.0.tar.gz", hash = "sha256:1c61603ff154621fb2a9172037d84dca3500def8c8b630657d1701f026f8af3f"}, +] + [[package]] name = "pytest" version = "8.1.1" @@ -1514,4 +1563,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = "^3.12" -content-hash = "e266453ebd9b5129ebefedeb92e20b96f1d09e7bb3f11a3f3c344991d8ca1144" +content-hash = "c11df56e3dd51e3dc0cd7be5f1c44c2f552b18a3fef74b56410cf5216f6def30" diff --git a/async_api/pyproject.toml b/async_api/pyproject.toml index 8cfb48e..1d501e5 100644 --- a/async_api/pyproject.toml +++ b/async_api/pyproject.toml @@ -15,6 +15,8 @@ fastapi = "^0.110.0" pydantic = "^2.6.4" uvicorn = "^0.28.0" uvloop = "^0.19.0" +flake8 = "^7.0.0" +black = "^24.2.0" [tool.poetry.group.dev.dependencies] # https://python-poetry.org/docs/master/managing-dependencies/ black = "^24.2.0" diff --git a/async_api/src/api/v1/films.py b/async_api/src/api/v1/films.py index 12409fc..031f12e 100644 --- a/async_api/src/api/v1/films.py +++ b/async_api/src/api/v1/films.py @@ -12,9 +12,9 @@ class Film(BaseModel): title: str -@router.get('/{film_id}', response_model=Film) +@router.get("/{film_id}", response_model=Film) async def film_details(film_id: str, film_service: FilmService = Depends(get_film_service)) -> Film: film = await film_service.get_by_id(film_id) if not film: - raise HTTPException(status_code=HTTPStatus.NOT_FOUND, detail='film not found') + raise HTTPException(status_code=HTTPStatus.NOT_FOUND, detail="film not found") return Film(id=film.id, title=film.title)