From f96e383af0dd565dcafe32cafce4f6106d87494f Mon Sep 17 00:00:00 2001 From: denys Date: Mon, 1 May 2023 20:10:12 +0300 Subject: [PATCH 1/4] python 3.11 --- poetry.lock | 171 ++++++++++++++++++++----------------------------- pyproject.toml | 2 +- 2 files changed, 70 insertions(+), 103 deletions(-) diff --git a/poetry.lock b/poetry.lock index e7f2cd7..42fef17 100644 --- a/poetry.lock +++ b/poetry.lock @@ -18,14 +18,14 @@ uvloop = ["uvloop (>=0.14,<0.15)", "uvloop (>=0.14,<0.15)", "uvloop (>=0.17,<0.1 [[package]] name = "alembic" -version = "1.10.3" +version = "1.10.4" description = "A database migration tool for SQLAlchemy." category = "main" optional = false python-versions = ">=3.7" files = [ - {file = "alembic-1.10.3-py3-none-any.whl", hash = "sha256:b2e0a6cfd3a8ce936a1168320bcbe94aefa3f4463cd773a968a55071beb3cd37"}, - {file = "alembic-1.10.3.tar.gz", hash = "sha256:32a69b13a613aeb7e8093f242da60eff9daed13c0df02fff279c1b06c32965d2"}, + {file = "alembic-1.10.4-py3-none-any.whl", hash = "sha256:43942c3d4bf2620c466b91c0f4fca136fe51ae972394a0cc8b90810d664e4f5c"}, + {file = "alembic-1.10.4.tar.gz", hash = "sha256:295b54bbb92c4008ab6a7dcd1e227e668416d6f84b98b3c4446a2bc6214a556b"}, ] [package.dependencies] @@ -212,8 +212,6 @@ click = ">=8.0.0" mypy-extensions = ">=0.4.3" pathspec = ">=0.9.0" platformdirs = ">=2" -tomli = {version = ">=1.1.0", markers = "python_full_version < \"3.11.0a7\""} -typing-extensions = {version = ">=3.10.0.0", markers = "python_version < \"3.10\""} [package.extras] colorama = ["colorama (>=0.4.3)"] @@ -425,21 +423,6 @@ files = [ dnspython = ">=1.15.0" idna = ">=2.0.0" -[[package]] -name = "exceptiongroup" -version = "1.1.1" -description = "Backport of PEP 654 (exception groups)" -category = "dev" -optional = false -python-versions = ">=3.7" -files = [ - {file = "exceptiongroup-1.1.1-py3-none-any.whl", hash = "sha256:232c37c63e4f682982c8b6459f33a8981039e5fb8756b2074364e5055c498c9e"}, - {file = "exceptiongroup-1.1.1.tar.gz", hash = "sha256:d484c3090ba2889ae2928419117447a14daf3c1231d5e30d0aae34f354f01785"}, -] - -[package.extras] -test = ["pytest (>=6)"] - [[package]] name = "executing" version = "1.2.0" @@ -479,14 +462,14 @@ test = ["anyio[trio] (>=3.2.1,<4.0.0)", "black (==23.1.0)", "coverage[toml] (>=6 [[package]] name = "fastapi-mail" -version = "1.2.7" +version = "1.2.8" description = "Simple lightweight mail library for FastApi" category = "main" optional = false python-versions = ">=3.8.1,<4.0" files = [ - {file = "fastapi_mail-1.2.7-py3-none-any.whl", hash = "sha256:26acc4201551203c7aa86a91b7c022fee3fe0d08824f0924dc0004448910852b"}, - {file = "fastapi_mail-1.2.7.tar.gz", hash = "sha256:22db99be0a842b0535d4cc01712a1677abcbb94fd11cca6bf5e8826139116b00"}, + {file = "fastapi_mail-1.2.8-py3-none-any.whl", hash = "sha256:1ea39d0b26943cb6e94d2b512cfc1295cfc5133df8d913c7db8da0f835802706"}, + {file = "fastapi_mail-1.2.8.tar.gz", hash = "sha256:5c650ffa92ca6922f700b4001a201f52e25999aafbf3c4d0f9150126aebe2df0"}, ] [package.dependencies] @@ -708,26 +691,26 @@ files = [ [[package]] name = "invoke" -version = "2.0.0" +version = "2.1.0" description = "Pythonic task execution" category = "main" optional = false python-versions = ">=3.6" files = [ - {file = "invoke-2.0.0-py3-none-any.whl", hash = "sha256:a860582bcf7a4b336fe18ef53937f0f28cec1c0053ffa767c2fcf7ba0b850f59"}, - {file = "invoke-2.0.0.tar.gz", hash = "sha256:7ab5dd9cd76b787d560a78b1a9810d252367ab595985c50612702be21d671dd7"}, + {file = "invoke-2.1.0-py3-none-any.whl", hash = "sha256:409c9cff8325d697f44308fda3026a97691972adc4ab81575d655a2100b50abc"}, + {file = "invoke-2.1.0.tar.gz", hash = "sha256:277894c57fa2b77f22ed3c7726fb8689773301e4497ccb2a59f19bc7bbbe5b4a"}, ] [[package]] name = "ipython" -version = "8.12.0" +version = "8.13.1" description = "IPython: Productive Interactive Computing" category = "main" optional = false -python-versions = ">=3.8" +python-versions = ">=3.9" files = [ - {file = "ipython-8.12.0-py3-none-any.whl", hash = "sha256:1c183bf61b148b00bcebfa5d9b39312733ae97f6dad90d7e9b4d86c8647f498c"}, - {file = "ipython-8.12.0.tar.gz", hash = "sha256:a950236df04ad75b5bc7f816f9af3d74dc118fd42f2ff7e80e8e60ca1f182e2d"}, + {file = "ipython-8.13.1-py3-none-any.whl", hash = "sha256:1c80d08f04144a1994cda25569eab07fbdc4989bd8d8793e3a4ff643065ccb51"}, + {file = "ipython-8.13.1.tar.gz", hash = "sha256:9c8487ac18f330c8a683fc50ab6d7bc0fcf9ef1d7a9f6ce7926938261067b81f"}, ] [package.dependencies] @@ -743,7 +726,6 @@ prompt-toolkit = ">=3.0.30,<3.0.37 || >3.0.37,<3.1.0" pygments = ">=2.4.0" stack-data = "*" traitlets = ">=5" -typing-extensions = {version = "*", markers = "python_version < \"3.10\""} [package.extras] all = ["black", "curio", "docrepr", "ipykernel", "ipyparallel", "ipywidgets", "matplotlib", "matplotlib (!=3.2.0)", "nbconvert", "nbformat", "notebook", "numpy (>=1.21)", "pandas", "pytest (<7)", "pytest (<7.1)", "pytest-asyncio", "qtconsole", "setuptools (>=18.5)", "sphinx (>=1.3)", "sphinx-rtd-theme", "stack-data", "testpath", "trio", "typing-extensions"] @@ -1014,19 +996,19 @@ files = [ [[package]] name = "platformdirs" -version = "3.2.0" +version = "3.5.0" description = "A small Python package for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." category = "dev" optional = false python-versions = ">=3.7" files = [ - {file = "platformdirs-3.2.0-py3-none-any.whl", hash = "sha256:ebe11c0d7a805086e99506aa331612429a72ca7cd52a1f0d277dc4adc20cb10e"}, - {file = "platformdirs-3.2.0.tar.gz", hash = "sha256:d5b638ca397f25f979350ff789db335903d7ea010ab28903f57b27e1b16c2b08"}, + {file = "platformdirs-3.5.0-py3-none-any.whl", hash = "sha256:47692bc24c1958e8b0f13dd727307cff1db103fca36399f457da8e05f222fdc4"}, + {file = "platformdirs-3.5.0.tar.gz", hash = "sha256:7954a68d0ba23558d753f73437c55f89027cf8f5108c19844d4b82e5af396335"}, ] [package.extras] -docs = ["furo (>=2022.12.7)", "proselint (>=0.13)", "sphinx (>=6.1.3)", "sphinx-autodoc-typehints (>=1.22,!=1.23.4)"] -test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=7.2.2)", "pytest-cov (>=4)", "pytest-mock (>=3.10)"] +docs = ["furo (>=2023.3.27)", "proselint (>=0.13)", "sphinx (>=6.1.3)", "sphinx-autodoc-typehints (>=1.23,!=1.23.4)"] +test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=7.3.1)", "pytest-cov (>=4)", "pytest-mock (>=3.10)"] [[package]] name = "pluggy" @@ -1276,11 +1258,9 @@ files = [ [package.dependencies] colorama = {version = "*", markers = "sys_platform == \"win32\""} -exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""} iniconfig = "*" packaging = "*" pluggy = ">=0.12,<2.0" -tomli = {version = ">=1.0.0", markers = "python_version < \"3.11\""} [package.extras] testing = ["argcomplete", "attrs (>=19.2.0)", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2.7.2)", "requests", "xmlschema"] @@ -1389,14 +1369,14 @@ files = [ [[package]] name = "requests" -version = "2.28.2" +version = "2.29.0" description = "Python HTTP for Humans." category = "main" optional = false -python-versions = ">=3.7, <4" +python-versions = ">=3.7" files = [ - {file = "requests-2.28.2-py3-none-any.whl", hash = "sha256:64299f4909223da747622c030b781c0d7811e359c37124b4bd368fb8c6518baa"}, - {file = "requests-2.28.2.tar.gz", hash = "sha256:98b1b2782e3c6c4904938b84c0eb932721069dfdb9134313beff7c83c2df24bf"}, + {file = "requests-2.29.0-py3-none-any.whl", hash = "sha256:e8f3c9be120d3333921d213eef078af392fba3933ab7ed2d1cba3b56f2568c3b"}, + {file = "requests-2.29.0.tar.gz", hash = "sha256:f2e34a75f4749019bb0e3effb66683630e4ffeaf75819fb51bebef1bf5aef059"}, ] [package.dependencies] @@ -1467,14 +1447,14 @@ files = [ [[package]] name = "sqladmin" -version = "0.10.2" +version = "0.10.3" description = "SQLAlchemy admin for FastAPI and Starlette" category = "main" optional = false python-versions = ">=3.7" files = [ - {file = "sqladmin-0.10.2-py3-none-any.whl", hash = "sha256:e7c66468537c3a052e7f392e17efc159b38cd9dcdda3ba14cf858a1016d6775f"}, - {file = "sqladmin-0.10.2.tar.gz", hash = "sha256:4b72cb3c4efdb6209de10499ef41b1b85bd0134d0b59c482258986e0c5f5a73e"}, + {file = "sqladmin-0.10.3-py3-none-any.whl", hash = "sha256:84592f68fe89a48db76edc70c7fd07e8d203966e5aedfebbdbbb15843cff0704"}, + {file = "sqladmin-0.10.3.tar.gz", hash = "sha256:75703df630c35a954b91bac8476cafa8abc65c5aae39c1e7405c0d11b758e925"}, ] [package.dependencies] @@ -1484,53 +1464,53 @@ wtforms = ">=3,<4" [[package]] name = "sqlalchemy" -version = "2.0.9" +version = "2.0.12" description = "Database Abstraction Library" category = "main" optional = false python-versions = ">=3.7" files = [ - {file = "SQLAlchemy-2.0.9-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:734805708632e3965c2c40081f9a59263c29ffa27cba9b02d4d92dfd57ba869f"}, - {file = "SQLAlchemy-2.0.9-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:8d3ece5960b3e821e43a4927cc851b6e84a431976d3ffe02aadb96519044807e"}, - {file = "SQLAlchemy-2.0.9-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8d118e233f416d713aac715e2c1101e17f91e696ff315fc9efbc75b70d11e740"}, - {file = "SQLAlchemy-2.0.9-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f005245e1cb9b8ca53df73ee85e029ac43155e062405015e49ec6187a2e3fb44"}, - {file = "SQLAlchemy-2.0.9-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:34eb96c1de91d8f31e988302243357bef3f7785e1b728c7d4b98bd0c117dafeb"}, - {file = "SQLAlchemy-2.0.9-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:7e472e9627882f2d75b87ff91c5a2bc45b31a226efc7cc0a054a94fffef85862"}, - {file = "SQLAlchemy-2.0.9-cp310-cp310-win32.whl", hash = "sha256:0a865b5ec4ba24f57c33b633b728e43fde77b968911a6046443f581b25d29dd9"}, - {file = "SQLAlchemy-2.0.9-cp310-cp310-win_amd64.whl", hash = "sha256:6e84ab63d25d8564d7a8c05dc080659931a459ee27f6ed1cf4c91f292d184038"}, - {file = "SQLAlchemy-2.0.9-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:db4bd1c4792da753f914ff0b688086b9a8fd78bb9bc5ae8b6d2e65f176b81eb9"}, - {file = "SQLAlchemy-2.0.9-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:ad5363a1c65fde7b7466769d4261126d07d872fc2e816487ae6cec93da604b6b"}, - {file = "SQLAlchemy-2.0.9-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ebc4eeb1737a5a9bdb0c24f4c982319fa6edd23cdee27180978c29cbb026f2bd"}, - {file = "SQLAlchemy-2.0.9-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bbda1da8d541904ba262825a833c9f619e93cb3fd1156be0a5e43cd54d588dcd"}, - {file = "SQLAlchemy-2.0.9-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:d5327f54a9c39e7871fc532639616f3777304364a0bb9b89d6033ad34ef6c5f8"}, - {file = "SQLAlchemy-2.0.9-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:ac6a0311fb21a99855953f84c43fcff4bdca27a2ffcc4f4d806b26b54b5cddc9"}, - {file = "SQLAlchemy-2.0.9-cp311-cp311-win32.whl", hash = "sha256:d209594e68bec103ad5243ecac1b40bf5770c9ebf482df7abf175748a34f4853"}, - {file = "SQLAlchemy-2.0.9-cp311-cp311-win_amd64.whl", hash = "sha256:865392a50a721445156809c1a6d6ab6437be70c1c2599f591a8849ed95d3c693"}, - {file = "SQLAlchemy-2.0.9-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:0b49f1f71d7a44329a43d3edd38cc5ee4c058dfef4487498393d16172007954b"}, - {file = "SQLAlchemy-2.0.9-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e4a019f723b6c1e6b3781be00fb9e0844bc6156f9951c836ff60787cc3938d76"}, - {file = "SQLAlchemy-2.0.9-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9838bd247ee42eb74193d865e48dd62eb50e45e3fdceb0fdef3351133ee53dcf"}, - {file = "SQLAlchemy-2.0.9-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:78612edf4ba50d407d0eb3a64e9ec76e6efc2b5d9a5c63415d53e540266a230a"}, - {file = "SQLAlchemy-2.0.9-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:f61ab84956dc628c8dfe9d105b6aec38afb96adae3e5e7da6085b583ff6ea789"}, - {file = "SQLAlchemy-2.0.9-cp37-cp37m-win32.whl", hash = "sha256:07950fc82f844a2de67ddb4e535f29b65652b4d95e8b847823ce66a6d540a41d"}, - {file = "SQLAlchemy-2.0.9-cp37-cp37m-win_amd64.whl", hash = "sha256:e62c4e762d6fd2901692a093f208a6a6575b930e9458ad58c2a7f080dd6132da"}, - {file = "SQLAlchemy-2.0.9-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:b3e5864eba71a3718236a120547e52c8da2ccb57cc96cecd0480106a0c799c92"}, - {file = "SQLAlchemy-2.0.9-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:1d06e119cf79a3d80ab069f064a07152eb9ba541d084bdaee728d8a6f03fd03d"}, - {file = "SQLAlchemy-2.0.9-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ee2946042cc7851842d7a086a92b9b7b494cbe8c3e7e4627e27bc912d3a7655e"}, - {file = "SQLAlchemy-2.0.9-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:13f984a190d249769a050634b248aef8991acc035e849d02b634ea006c028fa8"}, - {file = "SQLAlchemy-2.0.9-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:e4780be0f19e5894c17f75fc8de2fe1ae233ab37827125239ceb593c6f6bd1e2"}, - {file = "SQLAlchemy-2.0.9-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:68ed381bc340b4a3d373dbfec1a8b971f6350139590c4ca3cb722fdb50035777"}, - {file = "SQLAlchemy-2.0.9-cp38-cp38-win32.whl", hash = "sha256:aa5c270ece17c0c0e0a38f2530c16b20ea05d8b794e46c79171a86b93b758891"}, - {file = "SQLAlchemy-2.0.9-cp38-cp38-win_amd64.whl", hash = "sha256:1b69666e25cc03c602d9d3d460e1281810109e6546739187044fc256c67941ef"}, - {file = "SQLAlchemy-2.0.9-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:c6e27189ff9aebfb2c02fd252c629ea58657e7a5ff1a321b7fc9c2bf6dc0b5f3"}, - {file = "SQLAlchemy-2.0.9-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:c8239ce63a90007bce479adf5460d48c1adae4b933d8e39a4eafecfc084e503c"}, - {file = "SQLAlchemy-2.0.9-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4f759eccb66e6d495fb622eb7f4ac146ae674d829942ec18b7f5a35ddf029597"}, - {file = "SQLAlchemy-2.0.9-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:246712af9fc761d6c13f4f065470982e175d902e77aa4218c9cb9fc9ff565a0c"}, - {file = "SQLAlchemy-2.0.9-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:6b72dccc5864ea95c93e0a9c4e397708917fb450f96737b4a8395d009f90b868"}, - {file = "SQLAlchemy-2.0.9-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:93c78d42c14aa9a9e0866eacd5b48df40a50d0e2790ee377af7910d224afddcf"}, - {file = "SQLAlchemy-2.0.9-cp39-cp39-win32.whl", hash = "sha256:f49c5d3c070a72ecb96df703966c9678dda0d4cb2e2736f88d15f5e1203b4159"}, - {file = "SQLAlchemy-2.0.9-cp39-cp39-win_amd64.whl", hash = "sha256:4c3020afb144572c7bfcba9d7cce57ad42bff6e6115dffcfe2d4ae6d444a214f"}, - {file = "SQLAlchemy-2.0.9-py3-none-any.whl", hash = "sha256:e730603cae5747bc6d6dece98b45a57d647ed553c8d5ecef602697b1c1501cf2"}, - {file = "SQLAlchemy-2.0.9.tar.gz", hash = "sha256:95719215e3ec7337b9f57c3c2eda0e6a7619be194a5166c07c1e599f6afc20fa"}, + {file = "SQLAlchemy-2.0.12-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:10f1ff0ebe21d2cea89ead231ba3ecf75678463ab85f19ce2ce91207620737f3"}, + {file = "SQLAlchemy-2.0.12-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:978bee4ecbcdadf087220618409fb9be9509458df479528b70308f0599c7c519"}, + {file = "SQLAlchemy-2.0.12-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:53b2c8adbcbb59732fb21a024aaa261983655845d86e3fc26a5676cec0ebaa09"}, + {file = "SQLAlchemy-2.0.12-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:91f4b1bdc987ef85fe3a0ce5d26ac72ff8f60207b08272aa2a65494836391d69"}, + {file = "SQLAlchemy-2.0.12-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:dfd6385b662aea83e63dd4db5fe116eb11914022deb1745f0b57fa8470c18ffe"}, + {file = "SQLAlchemy-2.0.12-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:5e9d390727c11b9a7e583bf6770de36895c0936bddb98ae93ae99282e6428d5f"}, + {file = "SQLAlchemy-2.0.12-cp310-cp310-win32.whl", hash = "sha256:a4709457f1c317e347051498b91fa2b86c4bcdebf93c84e6d121a4fc8a397307"}, + {file = "SQLAlchemy-2.0.12-cp310-cp310-win_amd64.whl", hash = "sha256:f0843132168b44ca33c5e5a2046c954775dde8c580ce27f5cf2e134d0d9919e4"}, + {file = "SQLAlchemy-2.0.12-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:32762dba51b663609757f861584a722093487f53737e76474cc6e190904dc31b"}, + {file = "SQLAlchemy-2.0.12-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:5d709f43caee115b03b707b8cbbcb8b303045dd7cdc825b6d29857d71f3425ae"}, + {file = "SQLAlchemy-2.0.12-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9fe98e9d26778d7711ceee2c671741b4f54c74677668481d733d6f70747d7690"}, + {file = "SQLAlchemy-2.0.12-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2a3101252f3de9a18561c1fb0a68b1ee465485990aba458d4510f214bd5a582c"}, + {file = "SQLAlchemy-2.0.12-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:6b1fa0ffc378a7061c452cb4a1f804fad1b3b8aa8d0552725531d27941b2e3ed"}, + {file = "SQLAlchemy-2.0.12-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:c5268ec05c21e2ecf5bca09314bcaadfec01f02163088cd602db4379862958dd"}, + {file = "SQLAlchemy-2.0.12-cp311-cp311-win32.whl", hash = "sha256:77a06b0983faf9aa48ee6219d41ade39dee16ce90857cc181dbcf6918acd234d"}, + {file = "SQLAlchemy-2.0.12-cp311-cp311-win_amd64.whl", hash = "sha256:a022c588c0f413f8cddf9fcc597dbf317efeac4186d8bff9aa7f3219258348b0"}, + {file = "SQLAlchemy-2.0.12-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:b6ceca432ce88ad12aab5b5896c343a1993c90b325d9193dcd055e73e18a0439"}, + {file = "SQLAlchemy-2.0.12-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0e5501c78b5ab917f0f0f75ce7f0018f683a0a76e95f30e6561bf61c9ff69d43"}, + {file = "SQLAlchemy-2.0.12-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dc67efd00ce7f428a446ce012673c03c63c5abb5dec3f33750087b8bdc173bf0"}, + {file = "SQLAlchemy-2.0.12-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:1fac17c866111283cbcdb7024d646abb71fdd95f3ce975cf3710258bc55742fd"}, + {file = "SQLAlchemy-2.0.12-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:f30c5608c64fc9c1fa9a16277eb4784f782362566fe40ff8d283358c8f2c5fe0"}, + {file = "SQLAlchemy-2.0.12-cp37-cp37m-win32.whl", hash = "sha256:85b0efe1c71459ba435a6593f54a0e39334b16ba383e8010fdb9d0127ca51ba8"}, + {file = "SQLAlchemy-2.0.12-cp37-cp37m-win_amd64.whl", hash = "sha256:b76c2fde827522e21922418325c1b95c2d795cdecfb4bc261e4d37965199ee7f"}, + {file = "SQLAlchemy-2.0.12-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:aec5fb36b53125554ecc2285526eb5cc31b21f6cb059993c1c5ca831959de052"}, + {file = "SQLAlchemy-2.0.12-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:4ad525b9dd17b478a2ed8580d7f2bc46b0f5889153c6b1c099729583e395b4b9"}, + {file = "SQLAlchemy-2.0.12-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d9796d5c13b2b7f05084d0ce52528cf919f9bde9e0f10672a6393a4490415695"}, + {file = "SQLAlchemy-2.0.12-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6e1d50592cb24d1947c374c666add65ded7c181ec98a89ed17abbe9b8b2e2ff4"}, + {file = "SQLAlchemy-2.0.12-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:bf83700faa9642388fbd3167db3f6cbb2e88cc8367b8c22204f3f408ee782d25"}, + {file = "SQLAlchemy-2.0.12-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:297b752d4f30350b64175bbbd57dc94c061a35f5d1dba088d0a367dbbebabc94"}, + {file = "SQLAlchemy-2.0.12-cp38-cp38-win32.whl", hash = "sha256:369f6564e68a9c60f0b9dde121def491e651a4ba8dcdd652a93f1cd5977cd85c"}, + {file = "SQLAlchemy-2.0.12-cp38-cp38-win_amd64.whl", hash = "sha256:7eb25b981cbc9e7df9f56ad7ec4c6d77323090ca4b7147fcdc09d66535377759"}, + {file = "SQLAlchemy-2.0.12-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:f6ebadefc4331dda83c22519e1ea1e61104df6eb38abbb80ab91b0a8527a5c19"}, + {file = "SQLAlchemy-2.0.12-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:3745dee26a7ee012598577ad3b8f6e6cd50a49b2afa0cde9db668da6bf2c2319"}, + {file = "SQLAlchemy-2.0.12-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:09205893a84b6bedae0453d3f384f5d2a6499b6e45ad977549894cdcd85d8f1c"}, + {file = "SQLAlchemy-2.0.12-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8aad66215a3817a7a1d535769773333250de2653c89b53f7e2d42b677d398027"}, + {file = "SQLAlchemy-2.0.12-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:e495ad05a13171fbb5d72fe5993469c8bceac42bcf6b8f9f117a518ee7fbc353"}, + {file = "SQLAlchemy-2.0.12-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:03206576ca53f55b9de6e890273e498f4b2e6e687a9db9859bdcd21df5a63e53"}, + {file = "SQLAlchemy-2.0.12-cp39-cp39-win32.whl", hash = "sha256:87b2c2d13c3d1384859b60eabb3139e169ce68ada1d2963dbd0c7af797f16efe"}, + {file = "SQLAlchemy-2.0.12-cp39-cp39-win_amd64.whl", hash = "sha256:3c053c3f4c4e45d4c8b27977647566c140d6de3f61a4e2acb92ea24cf9911c7f"}, + {file = "SQLAlchemy-2.0.12-py3-none-any.whl", hash = "sha256:e752c34f7a2057ebe82c856698b9f277c633d4aad006bddf7af74598567c8931"}, + {file = "SQLAlchemy-2.0.12.tar.gz", hash = "sha256:bddfc5bd1dee5db0fddc9dab26f800c283f3243e7281bbf107200fed30125f9c"}, ] [package.dependencies] @@ -1599,23 +1579,10 @@ itsdangerous = {version = "*", optional = true, markers = "extra == \"full\""} jinja2 = {version = "*", optional = true, markers = "extra == \"full\""} python-multipart = {version = "*", optional = true, markers = "extra == \"full\""} pyyaml = {version = "*", optional = true, markers = "extra == \"full\""} -typing-extensions = {version = ">=3.10.0", markers = "python_version < \"3.10\""} [package.extras] full = ["httpx (>=0.22.0)", "itsdangerous", "jinja2", "python-multipart", "pyyaml"] -[[package]] -name = "tomli" -version = "2.0.1" -description = "A lil' TOML parser" -category = "dev" -optional = false -python-versions = ">=3.7" -files = [ - {file = "tomli-2.0.1-py3-none-any.whl", hash = "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc"}, - {file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"}, -] - [[package]] name = "traitlets" version = "5.9.0" @@ -1712,5 +1679,5 @@ email = ["email-validator"] [metadata] lock-version = "2.0" -python-versions = "^3.9" -content-hash = "0915b0698bfa2aedf253b3a145cdeaf241f04a77720026e148d2acfabf285248" +python-versions = "3.11.2" +content-hash = "0f41a4b71b29a6121893d5b3f314fd4be1af124c955455da841bbb7f54790ab8" diff --git a/pyproject.toml b/pyproject.toml index fc0db81..a6c26b7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ description = "" authors = ["Nikolay "] [tool.poetry.dependencies] -python = "^3.9" +python = "3.11.2" python-dotenv = "^0.18.0" setuptools = "^65.4.1" asyncpg = "^0.27.0" From ef76703e0f07ea497d696423e8367e452000151b Mon Sep 17 00:00:00 2001 From: denys Date: Tue, 2 May 2023 15:46:43 +0300 Subject: [PATCH 2/4] working commit --- .vscode/launch.json | 10 ++++++ app/config.py | 3 +- app/database.py | 2 +- app/model/__init__.py | 1 + app/model/grocery_item.py | 14 ++++++++ app/router/__init__.py | 2 ++ app/router/shopping_item.py | 34 ++++++++++++++++++ app/schema/__init__.py | 1 + app/schema/shopping_item.py | 14 ++++++++ migrations/versions/52cdb2557825_message.py | 34 ++++++++++++++++++ project.env | 2 +- tests/test_flutter/test_item.py | 38 +++++++++++++++++++++ 12 files changed, 151 insertions(+), 4 deletions(-) create mode 100644 app/model/grocery_item.py create mode 100644 app/router/shopping_item.py create mode 100644 app/schema/shopping_item.py create mode 100644 migrations/versions/52cdb2557825_message.py create mode 100644 tests/test_flutter/test_item.py diff --git a/.vscode/launch.json b/.vscode/launch.json index 9df8b72..b11ec7c 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -18,6 +18,16 @@ ], "jinja": true, "justMyCode": true + }, + { + "name": "Invoke", + "type": "python", + "request": "launch", + "module": "invoke", + "args": [ + "shell" + ], + "justMyCode": true } ] } \ No newline at end of file diff --git a/app/config.py b/app/config.py index e269bf3..31c4e52 100644 --- a/app/config.py +++ b/app/config.py @@ -8,13 +8,12 @@ class Settings(BaseSettings): ACCESS_TOKEN_EXPIRE_MINUTES: int = 30 DB_URI: str = "" DATABASE_URI: str = "" - DEV_DATABASE_URI: str = "" ADMIN_USER: str = "admin" ADMIN_PASS: str = "admin" ADMIN_EMAIL: EmailStr = "admin@admin.com" class Config: - env_file = ".env", "project.env" + env_file = ".env" @lru_cache diff --git a/app/database.py b/app/database.py index 5c06a14..8346985 100644 --- a/app/database.py +++ b/app/database.py @@ -10,7 +10,7 @@ settings: Settings = get_settings() -DB_URI = settings.DATABASE_URI if settings.DATABASE_URI else settings.DEV_DATABASE_URI +DB_URI = settings.DATABASE_URI if settings.DATABASE_URI else settings.DB_URI engine = create_engine(DB_URI) diff --git a/app/model/__init__.py b/app/model/__init__.py index 4c2f5b5..9116924 100644 --- a/app/model/__init__.py +++ b/app/model/__init__.py @@ -3,5 +3,6 @@ from .post import Post from .superuser import SuperUser from .base_user import BaseUser +from .grocery_item import GroceryItem from app.database import Base diff --git a/app/model/grocery_item.py b/app/model/grocery_item.py new file mode 100644 index 0000000..47d6b02 --- /dev/null +++ b/app/model/grocery_item.py @@ -0,0 +1,14 @@ +from sqlalchemy import Column, Integer, String +from app.database import Base + + +class GroceryItem(Base): + __tablename__ = "items" + + id = Column(Integer, primary_key=True) + name = Column(String(24)) + quantity = Column(Integer) + category = Column(String(64), nullable=False) + + def __repr__(self) -> str: + return f"<{self.id}: {self.name} ({self.quantity}) {self.category}>" diff --git a/app/router/__init__.py b/app/router/__init__.py index 4609de5..a4c3e04 100644 --- a/app/router/__init__.py +++ b/app/router/__init__.py @@ -4,12 +4,14 @@ from .auth import auth_router from .post import post_router from .user import user_router +from .shopping_item import shopping_item_router router = APIRouter(prefix="/api", tags=["API"]) router.include_router(auth_router) router.include_router(post_router) router.include_router(user_router) +router.include_router(shopping_item_router) @router.get("/list-endpoints/") diff --git a/app/router/shopping_item.py b/app/router/shopping_item.py new file mode 100644 index 0000000..b3384c1 --- /dev/null +++ b/app/router/shopping_item.py @@ -0,0 +1,34 @@ +from fastapi import Depends, APIRouter, status +from sqlalchemy.orm import Session +from app.logger import log +from app import schema, model +from app.database import get_db + + +shopping_item_router = APIRouter(prefix="/shopping", tags=["Items"]) + + +@shopping_item_router.get("/items", response_model=schema.ItemsList) +def get_items( + db: Session = Depends(get_db), +): + items = db.query(model.GroceryItem).all() + log(log.INFO, "Grocery items: %s", items) + return schema.ItemsList(items=items) + + +@shopping_item_router.post( + "/add", + status_code=status.HTTP_201_CREATED, + response_model=schema.GroceryItem, +) +def add_item(item: schema.GroceryItem, db: Session = Depends(get_db)): + new_item = model.GroceryItem( + name=item.name, + quantity=item.quantity, + category=item.category, + ) + db.add(new_item) + db.commit() + log(log.INFO, "Item added: %s", new_item) + return new_item diff --git a/app/schema/__init__.py b/app/schema/__init__.py index 717602f..857dbdd 100644 --- a/app/schema/__init__.py +++ b/app/schema/__init__.py @@ -2,3 +2,4 @@ from .user import BaseUser, User from .token import Token, TokenData from .post import Post, BasePost, PostList +from .shopping_item import GroceryItem, ItemsList diff --git a/app/schema/shopping_item.py b/app/schema/shopping_item.py new file mode 100644 index 0000000..9a72259 --- /dev/null +++ b/app/schema/shopping_item.py @@ -0,0 +1,14 @@ +from pydantic import BaseModel + + +class GroceryItem(BaseModel): + name: str + quantity: int + category: str + + class Config: + orm_mode = True + + +class ItemsList(BaseModel): + items: list[GroceryItem] diff --git a/migrations/versions/52cdb2557825_message.py b/migrations/versions/52cdb2557825_message.py new file mode 100644 index 0000000..6b48d24 --- /dev/null +++ b/migrations/versions/52cdb2557825_message.py @@ -0,0 +1,34 @@ +""" + +Revision ID: 52cdb2557825 +Revises: 9729f12acebd +Create Date: 2023-05-02 10:50:05.037283 + +""" +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = '52cdb2557825' +down_revision = '9729f12acebd' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.create_table('items', + sa.Column('id', sa.Integer(), nullable=False), + sa.Column('name', sa.String(length=24), nullable=True), + sa.Column('quantity', sa.Integer(), nullable=True), + sa.Column('category', sa.String(length=64), nullable=False), + sa.PrimaryKeyConstraint('id') + ) + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.drop_table('items') + # ### end Alembic commands ### diff --git a/project.env b/project.env index f576a76..b38a80b 100644 --- a/project.env +++ b/project.env @@ -9,7 +9,7 @@ ACCESS_TOKEN_EXPIRE_MINUTES=1440 DATABASE_NAME=db DATABASE_USERNAME=postgres -DATABASE_LOCAL_PORT=5435 +DATABASE_LOCAL_PORT=5437 DATABASE_PASSWORD=password DEV_DATABASE_URI=postgresql://${DATABASE_USERNAME}:${DATABASE_PASSWORD}@localhost:${DATABASE_LOCAL_PORT}/${DATABASE_NAME} diff --git a/tests/test_flutter/test_item.py b/tests/test_flutter/test_item.py new file mode 100644 index 0000000..938f25e --- /dev/null +++ b/tests/test_flutter/test_item.py @@ -0,0 +1,38 @@ +from fastapi.testclient import TestClient +from sqlalchemy.orm import Session +from app import model, schema + + +def test_items( + client: TestClient, + db: Session, +): + TESTING_ITEMS_NUMBER = 3 + for i in range(TESTING_ITEMS_NUMBER): + item = model.GroceryItem( + name=f"Item_{i}", + quantity=12, + category="diary", + ) + db.add(item) + db.commit() + + response = client.get( + "api/shopping/items", + ) + assert response.status_code == 200 + items_number = db.query(model.GroceryItem).all() + assert len(items_number) == TESTING_ITEMS_NUMBER + + +def test_add_items( + client: TestClient, + db: Session, +): + data = schema.GroceryItem( + name="Cheese", + quantity=12, + category="diary", + ) + response = client.post("api/shopping/add", json=data.dict()) + assert response.status_code == 201 From b204c700b691f7ee19925609470e0310ce056ecc Mon Sep 17 00:00:00 2001 From: denys Date: Tue, 2 May 2023 16:24:59 +0300 Subject: [PATCH 3/4] fix --- app/router/shopping_item.py | 23 ++++++++++++++++++++++- tests/test_flutter/test_item.py | 27 +++++++++++++++++++++++++-- 2 files changed, 47 insertions(+), 3 deletions(-) diff --git a/app/router/shopping_item.py b/app/router/shopping_item.py index b3384c1..ed53785 100644 --- a/app/router/shopping_item.py +++ b/app/router/shopping_item.py @@ -1,5 +1,6 @@ -from fastapi import Depends, APIRouter, status +from fastapi import Depends, APIRouter, status, HTTPException from sqlalchemy.orm import Session +from sqlalchemy.exc import SQLAlchemyError from app.logger import log from app import schema, model from app.database import get_db @@ -32,3 +33,23 @@ def add_item(item: schema.GroceryItem, db: Session = Depends(get_db)): db.commit() log(log.INFO, "Item added: %s", new_item) return new_item + + +@shopping_item_router.delete( + "/{item_id}", + status_code=status.HTTP_200_OK, +) +def delete_post( + item_id: int, + db: Session = Depends(get_db), +): + item = db.query(model.GroceryItem).filter_by(id=item_id).first() + db.delete(item) + try: + db.commit() + except SQLAlchemyError as e: + log(log.ERROR, "Error while deleting item - %s", e) + raise HTTPException( + status_code=status.HTTP_409_CONFLICT, detail="Error while deleting item" + ) + return status.HTTP_200_OK diff --git a/tests/test_flutter/test_item.py b/tests/test_flutter/test_item.py index 938f25e..6a38d69 100644 --- a/tests/test_flutter/test_item.py +++ b/tests/test_flutter/test_item.py @@ -21,8 +21,7 @@ def test_items( "api/shopping/items", ) assert response.status_code == 200 - items_number = db.query(model.GroceryItem).all() - assert len(items_number) == TESTING_ITEMS_NUMBER + assert db.query(model.GroceryItem).count() == TESTING_ITEMS_NUMBER def test_add_items( @@ -36,3 +35,27 @@ def test_add_items( ) response = client.post("api/shopping/add", json=data.dict()) assert response.status_code == 201 + + +def test_delete_items( + client: TestClient, + db: Session, +): + item = model.GroceryItem( + name="item_to_delete", + quantity=12, + category="diary", + ) + db.add(item) + db.commit() + + item_to_delete = ( + db.query(model.GroceryItem).filter_by(name="item_to_delete").first() + ) + assert item_to_delete.name == "item_to_delete" + assert db.query(model.GroceryItem).count() == 1 + + response = client.delete(f"api/shopping/{item_to_delete.id}") + assert response + assert response.status_code == 200 + assert db.query(model.GroceryItem).count() == 0 From c3ea0f949d2e0862add29ce65edf9c4e59120a2c Mon Sep 17 00:00:00 2001 From: denys Date: Tue, 2 May 2023 16:34:43 +0300 Subject: [PATCH 4/4] fix --- tests/test_flutter/test_item.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/test_flutter/test_item.py b/tests/test_flutter/test_item.py index 6a38d69..4962a3c 100644 --- a/tests/test_flutter/test_item.py +++ b/tests/test_flutter/test_item.py @@ -56,6 +56,5 @@ def test_delete_items( assert db.query(model.GroceryItem).count() == 1 response = client.delete(f"api/shopping/{item_to_delete.id}") - assert response assert response.status_code == 200 assert db.query(model.GroceryItem).count() == 0