From 81b930ba62bf46e052f36d9ba1de3d2eeffe21d2 Mon Sep 17 00:00:00 2001 From: kutuzov13 Date: Sat, 28 Dec 2024 16:57:47 +0300 Subject: [PATCH] feat: update pybotx --- app/bot/commands/credentials.py | 6 +- app/settings.py | 6 +- poetry.lock | 118 +++----------------------------- pybotx-submodule | 2 +- 4 files changed, 21 insertions(+), 111 deletions(-) diff --git a/app/bot/commands/credentials.py b/app/bot/commands/credentials.py index 75ee7b2..103ec0c 100644 --- a/app/bot/commands/credentials.py +++ b/app/bot/commands/credentials.py @@ -41,7 +41,11 @@ async def add_credentials_handler(message: IncomingMessage, bot: Bot) -> None: # Normally bot accounts doesn't added on the fly bot._bot_accounts_storage._bot_accounts.append( # noqa: WPS437 - BotAccountWithSecret(id=bot_id, host=host, secret_key=secret_key) + BotAccountWithSecret( + id=bot_id, + cts_host=host, + secret_key=secret_key, + ) ) await bot.answer_message("Credentials was added") diff --git a/app/settings.py b/app/settings.py index 4c5d234..69edbc6 100644 --- a/app/settings.py +++ b/app/settings.py @@ -45,7 +45,11 @@ def _build_credentials_from_string( host, secret_key, bot_id = [ str_value.strip() for str_value in credentials_str.split("@") ] - return BotAccountWithSecret(host=host, secret_key=secret_key, id=UUID(bot_id)) + return BotAccountWithSecret( + cts_url=host, + secret_key=secret_key, + id=UUID(bot_id), + ) settings = AppSettings() diff --git a/poetry.lock b/poetry.lock index 9f02e48..fce3c8a 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,10 +1,9 @@ -# This file is automatically @generated by Poetry and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. [[package]] name = "aiocsv" version = "1.2.5" description = "Asynchronous CSV reading/writing" -category = "main" optional = false python-versions = ">=3.6, <4" files = [ @@ -39,7 +38,6 @@ files = [ name = "aiofiles" version = "0.8.0" description = "File support for asyncio." -category = "main" optional = false python-versions = ">=3.6,<4.0" files = [ @@ -51,7 +49,6 @@ files = [ name = "anyio" version = "3.7.1" description = "High level compatibility layer for multiple asynchronous event loop implementations" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -60,7 +57,6 @@ files = [ ] [package.dependencies] -exceptiongroup = {version = "*", markers = "python_version < \"3.11\""} idna = ">=2.8" sniffio = ">=1.1" @@ -73,7 +69,6 @@ trio = ["trio (<0.22)"] name = "astor" version = "0.8.1" description = "Read/rewrite/write Python ASTs" -category = "dev" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,>=2.7" files = [ @@ -85,7 +80,6 @@ files = [ name = "attrs" version = "23.2.0" description = "Classes Without Boilerplate" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -105,7 +99,6 @@ tests-no-zope = ["attrs[tests-mypy]", "cloudpickle", "hypothesis", "pympler", "p name = "autoflake" version = "1.4" description = "Removes unused imports and unused variables" -category = "dev" optional = false python-versions = "*" files = [ @@ -119,7 +112,6 @@ pyflakes = ">=1.1.0" name = "bandit" version = "1.7.2" description = "Security oriented static analyser for python code." -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -142,7 +134,6 @@ yaml = ["PyYAML"] name = "black" version = "22.3.0" description = "The uncompromising code formatter." -category = "dev" optional = false python-versions = ">=3.6.2" files = [ @@ -176,7 +167,6 @@ click = ">=8.0.0" mypy-extensions = ">=0.4.3" pathspec = ">=0.9.0" platformdirs = ">=2" -tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} [package.extras] colorama = ["colorama (>=0.4.3)"] @@ -188,7 +178,6 @@ uvloop = ["uvloop (>=0.15.2)"] name = "certifi" version = "2024.2.2" description = "Python package for providing Mozilla's CA Bundle." -category = "main" optional = false python-versions = ">=3.6" files = [ @@ -200,7 +189,6 @@ files = [ name = "click" version = "8.1.7" description = "Composable command line interface toolkit" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -215,7 +203,6 @@ colorama = {version = "*", markers = "platform_system == \"Windows\""} name = "colorama" version = "0.4.6" description = "Cross-platform colored terminal text." -category = "main" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" files = [ @@ -227,7 +214,6 @@ files = [ name = "darglint" version = "1.8.1" description = "A utility for ensuring Google-style docstrings stay up to date with the source code." -category = "dev" optional = false python-versions = ">=3.6,<4.0" files = [ @@ -239,7 +225,6 @@ files = [ name = "docutils" version = "0.20.1" description = "Docutils -- Python Documentation Utilities" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -251,7 +236,6 @@ files = [ name = "eradicate" version = "2.3.0" description = "Removes commented-out code." -category = "dev" optional = false python-versions = "*" files = [ @@ -259,26 +243,10 @@ files = [ {file = "eradicate-2.3.0.tar.gz", hash = "sha256:06df115be3b87d0fc1c483db22a2ebb12bcf40585722810d809cc770f5031c37"}, ] -[[package]] -name = "exceptiongroup" -version = "1.2.0" -description = "Backport of PEP 654 (exception groups)" -category = "main" -optional = false -python-versions = ">=3.7" -files = [ - {file = "exceptiongroup-1.2.0-py3-none-any.whl", hash = "sha256:4bfd3996ac73b41e9b9628b04e079f193850720ea5945fc96a08633c66912f14"}, - {file = "exceptiongroup-1.2.0.tar.gz", hash = "sha256:91f5c769735f051a4290d52edd0858999b57e5876e9f85937691bd4c9fa3ed68"}, -] - -[package.extras] -test = ["pytest (>=6)"] - [[package]] name = "fastapi" version = "0.103.2" description = "FastAPI framework, high performance, easy to learn, fast to code, ready for production" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -299,7 +267,6 @@ all = ["email-validator (>=2.0.0)", "httpx (>=0.23.0)", "itsdangerous (>=1.1.0)" name = "flake8" version = "4.0.1" description = "the modular source code checker: pep8 pyflakes and co" -category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -316,7 +283,6 @@ pyflakes = ">=2.4.0,<2.5.0" name = "flake8-bandit" version = "2.1.2" description = "Automated security testing with bandit and flake8." -category = "dev" optional = false python-versions = "*" files = [ @@ -333,7 +299,6 @@ pycodestyle = "*" name = "flake8-broken-line" version = "0.4.0" description = "Flake8 plugin to forbid backslashes for line breaks" -category = "dev" optional = false python-versions = ">=3.6,<4.0" files = [ @@ -348,7 +313,6 @@ flake8 = ">=3.5,<5" name = "flake8-bugbear" version = "21.11.29" description = "A plugin for flake8 finding likely bugs and design problems in your program. Contains warnings that don't belong in pyflakes and pycodestyle." -category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -367,7 +331,6 @@ dev = ["coverage", "hypothesis", "hypothesmith (>=0.2)", "pre-commit"] name = "flake8-commas" version = "2.1.0" description = "Flake8 lint for trailing commas." -category = "dev" optional = false python-versions = "*" files = [ @@ -382,7 +345,6 @@ flake8 = ">=2" name = "flake8-comprehensions" version = "3.14.0" description = "A flake8 plugin to help you write better list/set/dict comprehensions." -category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -397,7 +359,6 @@ flake8 = ">=3.0,<3.2.0 || >3.2.0" name = "flake8-debugger" version = "4.1.2" description = "ipdb/pdb statement checker plugin for flake8" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -413,7 +374,6 @@ pycodestyle = "*" name = "flake8-docstrings" version = "1.7.0" description = "Extension for flake8 which uses pydocstyle to check docstrings" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -429,7 +389,6 @@ pydocstyle = ">=2.1" name = "flake8-eradicate" version = "1.4.0" description = "Flake8 plugin to find commented out code" -category = "dev" optional = false python-versions = ">=3.7,<4.0" files = [ @@ -446,7 +405,6 @@ flake8 = ">=3.5,<6" name = "flake8-isort" version = "4.2.0" description = "flake8 plugin that integrates isort ." -category = "dev" optional = false python-versions = "*" files = [ @@ -465,7 +423,6 @@ test = ["pytest-cov"] name = "flake8-polyfill" version = "1.0.2" description = "Polyfill package for Flake8 plugins" -category = "dev" optional = false python-versions = "*" files = [ @@ -480,7 +437,6 @@ flake8 = "*" name = "flake8-quotes" version = "3.4.0" description = "Flake8 lint for quotes." -category = "dev" optional = false python-versions = "*" files = [ @@ -495,7 +451,6 @@ setuptools = "*" name = "flake8-rst-docstrings" version = "0.2.7" description = "Python docstring reStructuredText (RST) validator" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -512,7 +467,6 @@ restructuredtext-lint = "*" name = "flake8-string-format" version = "0.3.0" description = "string format checker, plugin for flake8" -category = "dev" optional = false python-versions = "*" files = [ @@ -527,7 +481,6 @@ flake8 = "*" name = "gitdb" version = "4.0.11" description = "Git Object Database" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -542,7 +495,6 @@ smmap = ">=3.0.1,<6" name = "gitpython" version = "3.1.42" description = "GitPython is a Python library used to interact with Git repositories" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -560,7 +512,6 @@ test = ["black", "coverage[toml]", "ddt (>=1.1.1,!=1.4.3)", "mock", "mypy", "pre name = "h11" version = "0.14.0" description = "A pure-Python, bring-your-own-I/O implementation of HTTP/1.1" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -572,7 +523,6 @@ files = [ name = "httpcore" version = "1.0.2" description = "A minimal low-level HTTP client." -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -587,14 +537,13 @@ h11 = ">=0.13,<0.15" [package.extras] asyncio = ["anyio (>=4.0,<5.0)"] http2 = ["h2 (>=3,<5)"] -socks = ["socksio (>=1.0.0,<2.0.0)"] +socks = ["socksio (==1.*)"] trio = ["trio (>=0.22.0,<0.23.0)"] [[package]] name = "httpx" version = "0.25.2" description = "The next generation HTTP client." -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -605,21 +554,20 @@ files = [ [package.dependencies] anyio = "*" certifi = "*" -httpcore = ">=1.0.0,<2.0.0" +httpcore = "==1.*" idna = "*" sniffio = "*" [package.extras] brotli = ["brotli", "brotlicffi"] -cli = ["click (>=8.0.0,<9.0.0)", "pygments (>=2.0.0,<3.0.0)", "rich (>=10,<14)"] +cli = ["click (==8.*)", "pygments (==2.*)", "rich (>=10,<14)"] http2 = ["h2 (>=3,<5)"] -socks = ["socksio (>=1.0.0,<2.0.0)"] +socks = ["socksio (==1.*)"] [[package]] name = "idna" version = "3.6" description = "Internationalized Domain Names in Applications (IDNA)" -category = "main" optional = false python-versions = ">=3.5" files = [ @@ -631,7 +579,6 @@ files = [ name = "isort" version = "5.10.1" description = "A Python utility / library to sort Python imports." -category = "dev" optional = false python-versions = ">=3.6.1,<4.0" files = [ @@ -649,7 +596,6 @@ requirements-deprecated-finder = ["pip-api", "pipreqs"] name = "loguru" version = "0.6.0" description = "Python logging made (stupidly) simple" -category = "main" optional = false python-versions = ">=3.5" files = [ @@ -668,7 +614,6 @@ dev = ["Sphinx (>=4.1.1)", "black (>=19.10b0)", "colorama (>=0.3.4)", "docutils name = "mako" version = "1.3.2" description = "A super-fast templating language that borrows the best ideas from the existing templating languages." -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -688,7 +633,6 @@ testing = ["pytest"] name = "markupsafe" version = "2.1.5" description = "Safely add untrusted strings to HTML/XML markup." -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -758,7 +702,6 @@ files = [ name = "mccabe" version = "0.6.1" description = "McCabe checker, plugin for flake8" -category = "dev" optional = false python-versions = "*" files = [ @@ -770,7 +713,6 @@ files = [ name = "mypy" version = "1.0.1" description = "Optional static typing for Python" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -804,7 +746,6 @@ files = [ [package.dependencies] mypy-extensions = ">=0.4.3" -tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} typing-extensions = ">=3.10" [package.extras] @@ -817,7 +758,6 @@ reports = ["lxml"] name = "mypy-extensions" version = "0.4.4" description = "Experimental type system extensions for programs checked with the mypy typechecker." -category = "main" optional = false python-versions = ">=2.7" files = [ @@ -828,7 +768,6 @@ files = [ name = "pathspec" version = "0.12.1" description = "Utility library for gitignore style pattern matching of file paths." -category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -840,7 +779,6 @@ files = [ name = "pbr" version = "6.0.0" description = "Python Build Reasonableness" -category = "dev" optional = false python-versions = ">=2.6" files = [ @@ -852,7 +790,6 @@ files = [ name = "pep8-naming" version = "0.12.1" description = "Check PEP-8 naming conventions, plugin for flake8" -category = "dev" optional = false python-versions = "*" files = [ @@ -868,7 +805,6 @@ flake8-polyfill = ">=1.0.2,<2" name = "platformdirs" version = "4.2.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.8" files = [ @@ -882,24 +818,22 @@ test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=7.4.3)", "pytest- [[package]] name = "pybotx" -version = "0.63.0" +version = "0.73.1" description = "A python library for interacting with eXpress BotX API" -category = "main" optional = false -python-versions = ">=3.8,<3.12" +python-versions = ">=3.8,<3.13" files = [] develop = true [package.dependencies] aiocsv = ">=1.2.3,<1.3.0" -aiofiles = ">=0.7.0,<0.9.0" +aiofiles = ">=0.7.0,<24.0.0" httpcore = ">=1.0.0,<1.0.3" httpx = "^0.25.0" loguru = ">=0.6.0,<0.7.0" mypy-extensions = ">=0.2.0,<0.5.0" pydantic = ">=1.6.0,<1.11.0" pyjwt = ">=2.0.0,<3.0.0" -typing-extensions = ">=3.7.4,<5.0.0" [package.source] type = "directory" @@ -909,7 +843,6 @@ url = "pybotx-submodule" name = "pycodestyle" version = "2.8.0" description = "Python style guide checker" -category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" files = [ @@ -921,7 +854,6 @@ files = [ name = "pydantic" version = "1.10.14" description = "Data validation and settings management using python type hints" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -975,7 +907,6 @@ email = ["email-validator (>=1.0.3)"] name = "pydocstyle" version = "6.3.0" description = "Python docstring style checker" -category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -993,7 +924,6 @@ toml = ["tomli (>=1.2.3)"] name = "pyflakes" version = "2.4.0" description = "passive checker of Python programs" -category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" files = [ @@ -1005,7 +935,6 @@ files = [ name = "pygments" version = "2.17.2" description = "Pygments is a syntax highlighting package written in Python." -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1021,7 +950,6 @@ windows-terminal = ["colorama (>=0.4.6)"] name = "pyjwt" version = "2.8.0" description = "JSON Web Token implementation in Python" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -1039,7 +967,6 @@ tests = ["coverage[toml] (==5.0.4)", "pytest (>=6.0.0,<7.0.0)"] name = "python-dotenv" version = "1.0.1" description = "Read key-value pairs from a .env file and set them as environment variables" -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -1054,7 +981,6 @@ cli = ["click (>=5.0)"] name = "pyyaml" version = "6.0.1" description = "YAML parser and emitter for Python" -category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -1114,7 +1040,6 @@ files = [ name = "restructuredtext-lint" version = "1.4.0" description = "reStructuredText linter" -category = "dev" optional = false python-versions = "*" files = [ @@ -1128,7 +1053,6 @@ docutils = ">=0.11,<1.0" name = "setuptools" version = "69.1.1" description = "Easily download, build, install, upgrade, and uninstall Python packages" -category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -1145,7 +1069,6 @@ testing-integration = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "jar name = "smmap" version = "5.0.1" description = "A pure Python implementation of a sliding window memory map manager" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1157,7 +1080,6 @@ files = [ name = "sniffio" version = "1.3.1" description = "Sniff out which async library your code is running under" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -1169,7 +1091,6 @@ files = [ name = "snowballstemmer" version = "2.2.0" description = "This package provides 29 stemmers for 28 languages generated from Snowball algorithms." -category = "dev" optional = false python-versions = "*" files = [ @@ -1181,7 +1102,6 @@ files = [ name = "starlette" version = "0.27.0" description = "The little ASGI library that shines." -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -1199,7 +1119,6 @@ full = ["httpx (>=0.22.0)", "itsdangerous", "jinja2", "python-multipart", "pyyam name = "stevedore" version = "5.2.0" description = "Manage dynamic plugins for Python applications" -category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -1210,23 +1129,10 @@ files = [ [package.dependencies] pbr = ">=2.0.0,<2.1.0 || >2.1.0" -[[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 = "typing-extensions" version = "4.10.0" description = "Backported and Experimental Type Hints for Python 3.8+" -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -1238,7 +1144,6 @@ files = [ name = "uvicorn" version = "0.23.2" description = "The lightning-fast ASGI server." -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -1249,7 +1154,6 @@ files = [ [package.dependencies] click = ">=7.0" h11 = ">=0.8" -typing-extensions = {version = ">=4.0", markers = "python_version < \"3.11\""} [package.extras] standard = ["colorama (>=0.4)", "httptools (>=0.5.0)", "python-dotenv (>=0.13)", "pyyaml (>=5.1)", "uvloop (>=0.14.0,!=0.15.0,!=0.15.1)", "watchfiles (>=0.13)", "websockets (>=10.4)"] @@ -1258,7 +1162,6 @@ standard = ["colorama (>=0.4)", "httptools (>=0.5.0)", "python-dotenv (>=0.13)", name = "wemake-python-styleguide" version = "0.16.0" description = "The strictest and most opinionated python linter ever" -category = "dev" optional = false python-versions = ">=3.6,<4.0" files = [ @@ -1291,7 +1194,6 @@ typing_extensions = ">=3.6,<5.0" name = "win32-setctime" version = "1.1.0" description = "A small Python utility to set file creation time on Windows" -category = "main" optional = false python-versions = ">=3.5" files = [ @@ -1304,5 +1206,5 @@ dev = ["black (>=19.3b0)", "pytest (>=4.6.2)"] [metadata] lock-version = "2.0" -python-versions = "~3.10" -content-hash = "693da578194d9eafed1a05e0e0c0c373084a1c6e4b0b12866fa139af364d8baf" +python-versions = "~3.11" +content-hash = "71aaf7ab937fe3950a7ee784a17ac68bb41ee53e68a315889e278876c3694a2f" diff --git a/pybotx-submodule b/pybotx-submodule index fb09734..45eae0f 160000 --- a/pybotx-submodule +++ b/pybotx-submodule @@ -1 +1 @@ -Subproject commit fb09734601fa0b0e9f1d05072c8b152374446be8 +Subproject commit 45eae0fca566468e30901dfb3fe19f830253418d