Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #1

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 6 additions & 4 deletions botel/grpc_gate/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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))
Expand Down
6 changes: 3 additions & 3 deletions botel/utils/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]))
)
Expand Down
2 changes: 1 addition & 1 deletion botel/utils/normalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down