From 88cb0f09842fada29047e03d3770e6cfaf954688 Mon Sep 17 00:00:00 2001 From: mraniki Date: Tue, 10 Oct 2023 19:32:52 +0200 Subject: [PATCH 01/15] Add test_parse_ignore function to test_cex_exchange_plugin.py --- tests/test_cex_exchange_plugin.py | 10 ++++++++++ tt/plugins/default_plugins/cex_exchange_plugin.py | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/test_cex_exchange_plugin.py b/tests/test_cex_exchange_plugin.py index 42f43c2d9..9db56968a 100644 --- a/tests/test_cex_exchange_plugin.py +++ b/tests/test_cex_exchange_plugin.py @@ -90,3 +90,13 @@ async def test_parse_valid_order(plugin, order_message): plugin.fmo.search.assert_awaited_once plugin.fmo.get_order.assert_awaited_once plugin.exchange.submit_order.assert_awaited + + +@pytest.mark.asyncio +async def test_parse_ignore(plugin): + """Search Testing""" + + result = await plugin.handle_message("🏦 balance") + assert result is None + + \ No newline at end of file diff --git a/tt/plugins/default_plugins/cex_exchange_plugin.py b/tt/plugins/default_plugins/cex_exchange_plugin.py index 538361b05..ce406c2c3 100644 --- a/tt/plugins/default_plugins/cex_exchange_plugin.py +++ b/tt/plugins/default_plugins/cex_exchange_plugin.py @@ -60,7 +60,7 @@ async def handle_message(self, msg): """ if not self.should_handle(msg): return - logger.debug("settings.bot_ignore: %s", settings.bot_ignore) + logger.debug("settings.bot_ignore: {}", settings.bot_ignore) if not msg.startswith(settings.bot_ignore): if await self.fmo.search(msg): order = await self.fmo.get_order(msg) From f372f67ab541b2a4170790fe363678a654f2fbe7 Mon Sep 17 00:00:00 2001 From: mraniki Date: Tue, 10 Oct 2023 19:45:46 +0200 Subject: [PATCH 02/15] Add Bandit configuration to exclude "tests" directory --- pyproject.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index ad8c3488f..1e17e4932 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -133,6 +133,8 @@ omit = [ "*/config.py" ] +[tool.bandit] +exclude_dirs = ["tests"] [tool.semantic_release] build_command = "pip install poetry && poetry build" From ec7eed51efc9a7a38528503ee59db5106516ebdf Mon Sep 17 00:00:00 2001 From: mraniki <8766259+mraniki@users.noreply.github.com> Date: Tue, 10 Oct 2023 20:00:34 +0200 Subject: [PATCH 03/15] Update pyproject.toml --- pyproject.toml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 1e17e4932..9e313a6af 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -134,7 +134,10 @@ omit = [ ] [tool.bandit] -exclude_dirs = ["tests"] +exclude_dirs = ["tests","docs"] + +[tool.bandit.assert_used] +skips = ["*_test.py", "test_*.py"] [tool.semantic_release] build_command = "pip install poetry && poetry build" From ce14ffed3d6fb7da61f1714279c5ee183f122158 Mon Sep 17 00:00:00 2001 From: mraniki <8766259+mraniki@users.noreply.github.com> Date: Tue, 10 Oct 2023 20:07:37 +0200 Subject: [PATCH 04/15] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20pyproject=20update?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyproject.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 9e313a6af..cdcbfd7d8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -59,7 +59,9 @@ myllm = "3.1.17" [tool.poetry.group.dev.dependencies] python-semantic-release = ">=8.0.8" -ruff = "*" +ruff = "^0.0.265" +black = "^23.3.0" +pre-commit = "^3.3.1" [tool.poetry.group.docs] optional = true @@ -112,8 +114,6 @@ exclude = [ "docs/*" ] fixable = ["ALL"] -# ignore = ["E401","F401"] -#format = "github" select = [ "E", # pycodestyle "F", # pyflakes From d0f0ca10ba90fa331e6af49e8758b052b4201576 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 10 Oct 2023 18:07:53 +0000 Subject: [PATCH 05/15] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20=F0=9F=9B=A0?= =?UTF-8?q?=EF=B8=8F(deps):=20update=20dependency=20ruff=20to=20^0.0.292?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index cdcbfd7d8..36fdc89d3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -59,7 +59,7 @@ myllm = "3.1.17" [tool.poetry.group.dev.dependencies] python-semantic-release = ">=8.0.8" -ruff = "^0.0.265" +ruff = "^0.0.292" black = "^23.3.0" pre-commit = "^3.3.1" From 1d6604ab76465e23d04cbafb63291121fba3f7e5 Mon Sep 17 00:00:00 2001 From: mraniki <8766259+mraniki@users.noreply.github.com> Date: Tue, 10 Oct 2023 20:19:04 +0200 Subject: [PATCH 06/15] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20dep=20upgrade?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyproject.toml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 36fdc89d3..140039a1a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -49,12 +49,12 @@ apprise = "^1.5.0" asyncz = ">=0.3.1" nicegui = "^1.3.15" ping3 = "^4.0.4" -iamlistening = "4.2.8" -findmyorder = "1.8.0" -dxsp = "5.2.6" -cefi = "3.1.4" +iamlistening = "4.2.9" +findmyorder = "1.8.1" +dxsp = "5.2.7" +cefi = "3.1.5" talkytrend = "1.15.1" -myllm = "3.1.17" +myllm = "3.1.18" [tool.poetry.group.dev.dependencies] From b1a4950ca2442fe2951f631e325e98cabde36e7a Mon Sep 17 00:00:00 2001 From: mraniki <8766259+mraniki@users.noreply.github.com> Date: Tue, 10 Oct 2023 20:50:36 +0200 Subject: [PATCH 07/15] =?UTF-8?q?=F0=9F=94=92=20bandit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/.pre-commit-config.yaml | 18 ++++++++---------- pyproject.toml | 4 +--- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/.github/.pre-commit-config.yaml b/.github/.pre-commit-config.yaml index 61d42c984..05a6ef00c 100644 --- a/.github/.pre-commit-config.yaml +++ b/.github/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.0.291 + rev: v0.0.292 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] @@ -9,14 +9,12 @@ repos: rev: v4.4.0 hooks: - id: check-merge-conflict - - id: check-toml - id: trailing-whitespace - - repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks - rev: v2.10.0 + + - repo: https://github.com/PyCQA/bandit + rev: '1.7.5' hooks: - - id: pretty-format-toml - args: [--autofix] -# - repo: https://github.com/pre-commit/mirrors-prettier -# rev: '' # Use the sha / tag you want to point at -# hooks: -# - id: prettier \ No newline at end of file + - id: bandit + args: ["-c", "pyproject.toml", "--quiet", "--format=custom"] + files: ^dvc/ + additional_dependencies: [".[toml]"] \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 140039a1a..092311da7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -135,9 +135,7 @@ omit = [ [tool.bandit] exclude_dirs = ["tests","docs"] - -[tool.bandit.assert_used] -skips = ["*_test.py", "test_*.py"] +skips = ["B101"] [tool.semantic_release] build_command = "pip install poetry && poetry build" From cb930ab19ca78ab71a699e919e263eb00c74304c Mon Sep 17 00:00:00 2001 From: mraniki <8766259+mraniki@users.noreply.github.com> Date: Tue, 10 Oct 2023 20:55:19 +0200 Subject: [PATCH 08/15] =?UTF-8?q?=F0=9F=91=B7=20CI=20Change=20with=20preco?= =?UTF-8?q?mmit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/.pre-commit-config.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/.pre-commit-config.yaml b/.github/.pre-commit-config.yaml index 05a6ef00c..9adff499a 100644 --- a/.github/.pre-commit-config.yaml +++ b/.github/.pre-commit-config.yaml @@ -15,6 +15,4 @@ repos: rev: '1.7.5' hooks: - id: bandit - args: ["-c", "pyproject.toml", "--quiet", "--format=custom"] - files: ^dvc/ - additional_dependencies: [".[toml]"] \ No newline at end of file + args: ["-c", "pyproject.toml"] \ No newline at end of file From fe140c442a447a1ed5092aa90bfe11f34de3e92f Mon Sep 17 00:00:00 2001 From: mraniki <8766259+mraniki@users.noreply.github.com> Date: Tue, 10 Oct 2023 21:13:55 +0200 Subject: [PATCH 09/15] =?UTF-8?q?=F0=9F=94=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyproject.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 092311da7..9e9ac5faa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -135,7 +135,8 @@ omit = [ [tool.bandit] exclude_dirs = ["tests","docs"] -skips = ["B101"] +skips = ["B101","B104"] + [tool.semantic_release] build_command = "pip install poetry && poetry build" From db2c171eeb51a283e3e62f31d88a4d51a838f33f Mon Sep 17 00:00:00 2001 From: mraniki Date: Tue, 10 Oct 2023 21:31:06 +0200 Subject: [PATCH 10/15] Update pre-commit config with black hook for Python 3.11 --- .github/.pre-commit-config.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/.pre-commit-config.yaml b/.github/.pre-commit-config.yaml index 9adff499a..761f5a380 100644 --- a/.github/.pre-commit-config.yaml +++ b/.github/.pre-commit-config.yaml @@ -5,6 +5,12 @@ repos: - id: ruff args: [--fix, --exit-non-zero-on-fix] + - repo: https://github.com/psf/black-pre-commit-mirror + rev: 23.9.1 + hooks: + - id: black + language_version: python3.11 + - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.4.0 hooks: From 395519e0cd8f4e343aacc49fa447855d1632d20d Mon Sep 17 00:00:00 2001 From: mraniki Date: Tue, 10 Oct 2023 21:47:05 +0200 Subject: [PATCH 11/15] Add automatic merge on approval rule - Added a new file `.github/.mergify.yml` with rules for automatic mergi ng of pull requests on approval. The rules include conditions for succes sful build and test checks, as well as no check failures. The merge meth od used is the default merge. --- .github/.mergify.yml | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .github/.mergify.yml diff --git a/.github/.mergify.yml b/.github/.mergify.yml new file mode 100644 index 000000000..ef882e55d --- /dev/null +++ b/.github/.mergify.yml @@ -0,0 +1,9 @@ +pull_request_rules: + - name: Automatic merge on approval + conditions: + - "check-success=build" + - "check-success=test" + - "#check-failure=0" + actions: + merge: + method: merge From bf9d6216e0beae72fa263959f2996306bd1231e6 Mon Sep 17 00:00:00 2001 From: mraniki Date: Tue, 10 Oct 2023 22:11:56 +0200 Subject: [PATCH 12/15] Update pyproject.toml with new dependencies - talkytrend = "1.15.1" -> talkytrend = "1.15.2" - findmyorder = "1.8.1" -> findmyorder = "1.8.2" - dxsp = "5.2.7" -> dxsp = "5.2.8" - cefi = "3.1.5" -> cefi = "3.1.6" - myllm = "3.1.18" -> myllm = "3.1.19 --- pyproject.toml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 9e9ac5faa..8cfc69172 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -49,12 +49,12 @@ apprise = "^1.5.0" asyncz = ">=0.3.1" nicegui = "^1.3.15" ping3 = "^4.0.4" +talkytrend = "1.15.2" iamlistening = "4.2.9" -findmyorder = "1.8.1" -dxsp = "5.2.7" -cefi = "3.1.5" -talkytrend = "1.15.1" -myllm = "3.1.18" +findmyorder = "1.8.2" +dxsp = "5.2.8" +cefi = "3.1.6" +myllm = "3.1.19" [tool.poetry.group.dev.dependencies] From 6caab21d62f98adb2d2ba781b0e2f1c103b99d67 Mon Sep 17 00:00:00 2001 From: mraniki Date: Tue, 10 Oct 2023 21:21:56 +0000 Subject: [PATCH 13/15] Update Requirements --- .requirements/requirements.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.requirements/requirements.txt b/.requirements/requirements.txt index 7c59d0158..dfa6d54c0 100644 --- a/.requirements/requirements.txt +++ b/.requirements/requirements.txt @@ -20,8 +20,8 @@ blurhash==1.1.4 ; python_version >= "3.10" and python_version < "4.0" brotli==1.1.0 ; platform_python_implementation == "CPython" and python_version >= "3.10" and python_version < "4.0" brotlicffi==1.1.0.0 ; platform_python_implementation != "CPython" and python_version >= "3.10" and python_version < "4.0" browser-cookie3==0.19.1 ; python_version >= "3.10" and python_version < "4.0" -ccxt==4.1.1 ; python_version >= "3.10" and python_version < "4.0" -cefi==3.1.4 ; python_version >= "3.10" and python_version < "4.0" +ccxt==4.1.9 ; python_version >= "3.10" and python_version < "4.0" +cefi==3.1.6 ; python_version >= "3.10" and python_version < "4.0" certifi==2023.7.22 ; python_version >= "3.10" and python_version < "4.0" cffi==1.16.0 ; python_version >= "3.10" and python_version < "4.0" charset-normalizer==3.3.0 ; python_version >= "3.10" and python_version < "4.0" @@ -32,7 +32,7 @@ curl-cffi==0.5.7 ; python_version >= "3.10" and python_version < "4.0" cytoolz==0.12.2 ; python_version >= "3.10" and python_version < "4" and implementation_name == "cpython" decorator==5.1.1 ; python_version >= "3.10" and python_version < "4.0" duckduckgo-search==3.8.5 ; python_version >= "3.10" and python_version < "4.0" -dxsp==5.2.6 ; python_version >= "3.10" and python_version < "4.0" +dxsp==5.2.8 ; python_version >= "3.10" and python_version < "4.0" dynaconf==3.2.3 ; python_version >= "3.10" and python_version < "4.0" eth-abi==4.2.1 ; python_version >= "3.10" and python_version < "4" eth-account==0.9.0 ; python_version >= "3.10" and python_version < "4" @@ -46,7 +46,7 @@ eth-utils==2.2.1 ; python_version >= "3.10" and python_version < "4" exceptiongroup==1.1.3 ; python_version >= "3.10" and python_version < "3.11" fastapi-socketio==0.0.10 ; python_version >= "3.10" and python_version < "4.0" fastapi==0.95.2 ; python_version >= "3.10" and python_version < "4.0" -findmyorder==1.8.0 ; python_version >= "3.10" and python_version < "4.0" +findmyorder==1.8.2 ; python_version >= "3.10" and python_version < "4.0" flask-cors==4.0.0 ; python_version >= "3.10" and python_version < "4.0" flask==3.0.0 ; python_version >= "3.10" and python_version < "4.0" frozendict==2.3.8 ; python_version >= "3.10" and python_version < "4.0" @@ -66,7 +66,7 @@ httptools==0.6.0 ; python_version >= "3.10" and python_version < "4.0" httpx==0.24.1 ; python_version >= "3.10" and python_version < "4.0" httpx[brotli,http2,socks]==0.24.1 ; python_version >= "3.10" and python_version < "4.0" hyperframe==6.0.1 ; python_version >= "3.10" and python_version < "4.0" -iamlistening==4.2.8 ; python_version >= "3.10" and python_version < "4.0" +iamlistening==4.2.9 ; python_version >= "3.10" and python_version < "4.0" idna==3.4 ; python_version >= "3.10" and python_version < "4.0" iso8601==2.1.0 ; python_version >= "3.10" and python_version < "4.0" itsdangerous==2.1.2 ; python_version >= "3.10" and python_version < "4.0" @@ -88,7 +88,7 @@ mastodon-py==1.8.1 ; python_version >= "3.10" and python_version < "4.0" matrix-nio==0.20.2 ; python_version >= "3.10" and python_version < "4.0" multidict==6.0.4 ; python_version >= "3.10" and python_version < "4.0" multitasking==0.0.11 ; python_version >= "3.10" and python_version < "4.0" -myllm==3.1.17 ; python_version >= "3.10" and python_version < "4.0" +myllm==3.1.19 ; python_version >= "3.10" and python_version < "4.0" nicegui==1.3.16 ; python_version >= "3.10" and python_version < "4.0" numpy==1.25.2 ; python_version >= "3.10" and python_version < "4.0" oauthlib==3.2.2 ; python_version >= "3.10" and python_version < "4.0" @@ -148,7 +148,7 @@ sniffio==1.3.0 ; python_version >= "3.10" and python_version < "4.0" socksio==1.0.0 ; python_version >= "3.10" and python_version < "4.0" soupsieve==2.5 ; python_version >= "3.10" and python_version < "4.0" starlette==0.27.0 ; python_version >= "3.10" and python_version < "4.0" -talkytrend==1.15.1 ; python_version >= "3.10" and python_version < "4.0" +talkytrend==1.15.2 ; python_version >= "3.10" and python_version < "4.0" telethon==1.30.3 ; python_version >= "3.10" and python_version < "4.0" toml==0.10.2 ; python_version >= "3.10" and python_version < "4.0" toolz==0.12.0 ; python_version >= "3.10" and python_version < "4" and (implementation_name == "pypy" or implementation_name == "cpython") From 5bdb7537b12f1b40d606e2d33c8ceaf5818dd3da Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 10 Oct 2023 21:22:11 +0000 Subject: [PATCH 14/15] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20=F0=9F=9B=A0?= =?UTF-8?q?=EF=B8=8F(deps):=20update=20dependency=20iamlistening=20to=20v4?= =?UTF-8?q?.2.10?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 8cfc69172..ac1c6f1b2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -50,7 +50,7 @@ asyncz = ">=0.3.1" nicegui = "^1.3.15" ping3 = "^4.0.4" talkytrend = "1.15.2" -iamlistening = "4.2.9" +iamlistening = "4.2.10" findmyorder = "1.8.2" dxsp = "5.2.8" cefi = "3.1.6" From 83f2c28baccb8718f36de29c363910669918c45e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Tue, 10 Oct 2023 21:26:00 +0000 Subject: [PATCH 15/15] Update Requirements --- .requirements/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.requirements/requirements.txt b/.requirements/requirements.txt index dfa6d54c0..3b35fde6d 100644 --- a/.requirements/requirements.txt +++ b/.requirements/requirements.txt @@ -66,7 +66,7 @@ httptools==0.6.0 ; python_version >= "3.10" and python_version < "4.0" httpx==0.24.1 ; python_version >= "3.10" and python_version < "4.0" httpx[brotli,http2,socks]==0.24.1 ; python_version >= "3.10" and python_version < "4.0" hyperframe==6.0.1 ; python_version >= "3.10" and python_version < "4.0" -iamlistening==4.2.9 ; python_version >= "3.10" and python_version < "4.0" +iamlistening==4.2.10 ; python_version >= "3.10" and python_version < "4.0" idna==3.4 ; python_version >= "3.10" and python_version < "4.0" iso8601==2.1.0 ; python_version >= "3.10" and python_version < "4.0" itsdangerous==2.1.2 ; python_version >= "3.10" and python_version < "4.0"