diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ea8ec06..f99ea94 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ ci: autoupdate_schedule: quarterly repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.5.1" + rev: "v0.6.8" hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] diff --git a/conftest.py b/conftest.py index f28f6f5..3cae0d1 100644 --- a/conftest.py +++ b/conftest.py @@ -2,9 +2,10 @@ # third party import pytest -from iembot.basicbot import basicbot from pyiem.database import get_dbconnc +from iembot.basicbot import basicbot + @pytest.fixture() def bot(): diff --git a/iembot.tac b/iembot.tac index 15bd941..ca3d444 100644 --- a/iembot.tac +++ b/iembot.tac @@ -3,8 +3,6 @@ # Base Python import json -# Local Import -from iembot import iemchatbot, webservices from psycopg.rows import dict_row # Twisted Bits @@ -14,6 +12,9 @@ from twisted.internet import reactor from twisted.web import server from txyam.client import YamClient +# Local Import +from iembot import iemchatbot, webservices + with open("settings.json", encoding="utf-8") as fh: dbconfig = json.load(fh) @@ -58,4 +59,5 @@ r.setServiceParent(serviceCollection) # Increase threadpool size to do more work at once # 128 not large enough when SPC's products come through :/ -reactor.getThreadPool().adjustPoolsize(maxthreads=256) +# 256 is not enough for hurricanes +reactor.getThreadPool().adjustPoolsize(maxthreads=512) diff --git a/tests/test_util.py b/tests/test_util.py index b14b3b6..856cf49 100644 --- a/tests/test_util.py +++ b/tests/test_util.py @@ -3,17 +3,17 @@ import tempfile from unittest import mock -# local -import iembot.util as botutil - # Third party modules import pytest -from iembot.basicbot import basicbot -from iembot.iemchatbot import JabberClient from twisted.python.failure import Failure from twisted.words.xish.domish import Element from twitter.error import TwitterError +# local +import iembot.util as botutil +from iembot.basicbot import basicbot +from iembot.iemchatbot import JabberClient + @pytest.mark.parametrize("database", ["mesosite"]) def test_load_mastodon_from_db(dbcursor): diff --git a/tests/test_util_channels.py b/tests/test_util_channels.py index b20b346..97ff5be 100644 --- a/tests/test_util_channels.py +++ b/tests/test_util_channels.py @@ -1,6 +1,7 @@ """Test things done with channel subs.""" import pytest + from iembot.util import ( channels_room_add, channels_room_del,