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 diff --git a/.github/.pre-commit-config.yaml b/.github/.pre-commit-config.yaml index 61d42c984..761f5a380 100644 --- a/.github/.pre-commit-config.yaml +++ b/.github/.pre-commit-config.yaml @@ -1,22 +1,24 @@ 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] + - 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: - 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"] \ No newline at end of file diff --git a/.requirements/requirements.txt b/.requirements/requirements.txt index 7c59d0158..3b35fde6d 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.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" @@ -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") diff --git a/pyproject.toml b/pyproject.toml index ad8c3488f..ac1c6f1b2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -49,17 +49,19 @@ 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" -talkytrend = "1.15.1" -myllm = "3.1.17" +talkytrend = "1.15.2" +iamlistening = "4.2.10" +findmyorder = "1.8.2" +dxsp = "5.2.8" +cefi = "3.1.6" +myllm = "3.1.19" [tool.poetry.group.dev.dependencies] python-semantic-release = ">=8.0.8" -ruff = "*" +ruff = "^0.0.292" +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 @@ -133,6 +133,10 @@ omit = [ "*/config.py" ] +[tool.bandit] +exclude_dirs = ["tests","docs"] +skips = ["B101","B104"] + [tool.semantic_release] build_command = "pip install poetry && poetry build" 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)