diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c0cd6e6..a4ee30a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,13 +8,13 @@ repos: args: ["-f", "requirements.txt", "-o", "requirements.txt", "--without-hashes"] - repo: https://github.com/psf/black - rev: 23.3.0 + rev: 25.1.0 hooks: - id: black exclude: alembic - repo: https://github.com/pycqa/isort - rev: 5.12.0 + rev: 6.0.0 hooks: - id: isort # options in pyproject.toml diff --git a/botel/grpc_gate/server.py b/botel/grpc_gate/server.py index 256688e..9624be6 100644 --- a/botel/grpc_gate/server.py +++ b/botel/grpc_gate/server.py @@ -72,9 +72,11 @@ async def PublishSuperPage(self, request, context, db: AsyncSession): chat_id=request.chat_id, text=message, parse_mode="html", - reply_to_message_id=previous_published_messages[0].message_id - if request.reference_original and previous_published_messages - else None, + reply_to_message_id=( + previous_published_messages[0].message_id + if request.reference_original and previous_published_messages + else None + ), ) final_coroutines.append( create.publish_record(db, page_id=request.id, message_id=new_message.id) @@ -111,7 +113,7 @@ async def InstanceDetail(self, request, context, db): async def serve( - db_initializer: tuple[Callable[[], SessionContextManager], sessionmaker] + db_initializer: tuple[Callable[[], SessionContextManager], sessionmaker], ): logging.basicConfig() # server = grpc.server(futures.ThreadPoolExecutor(max_workers=10)) diff --git a/botel/utils/common.py b/botel/utils/common.py index 9b9622b..90fb9f9 100644 --- a/botel/utils/common.py +++ b/botel/utils/common.py @@ -34,9 +34,9 @@ async def wrapper(self, *args, **kwargs): async with AsyncExitStack() as stack: managers = [] for i in initializers: - initializer: tuple[ - Callable[[Any], AsyncContextManager], tuple - ] = getattr(self, i) + initializer: tuple[Callable[[Any], AsyncContextManager], tuple] = ( + getattr(self, i) + ) managers.append( await stack.enter_async_context(initializer[0](*initializer[1])) ) diff --git a/botel/utils/normalize.py b/botel/utils/normalize.py index d7cf743..3eb88c7 100644 --- a/botel/utils/normalize.py +++ b/botel/utils/normalize.py @@ -48,7 +48,7 @@ def wrapper(elements: ResultSet): if child.name == "li": count += 1 child.insert_before( - "\N{bullet}" if element.name == "ul" else f"{count}) " + "\N{BULLET}" if element.name == "ul" else f"{count}) " ) child.insert_after("\n") child.unwrap()