diff --git a/.github/workflows/tag_and_publish.yml b/.github/workflows/tag_and_publish.yml index 552c3e06..d3b2559d 100644 --- a/.github/workflows/tag_and_publish.yml +++ b/.github/workflows/tag_and_publish.yml @@ -4,6 +4,7 @@ on: push: branches: - dev + workflow_dispatch: jobs: tag_and_publish: diff --git a/compiler/api/compiler.py b/compiler/api/compiler.py index c1cea073..e584d55b 100644 --- a/compiler/api/compiler.py +++ b/compiler/api/compiler.py @@ -119,7 +119,7 @@ def get_type_hint(type: str) -> str: ns, name = type.split(".") if "." in type else ("", type) type = '"raw.base.' + ".".join([ns, name]).strip(".") + '"' - return f'{type}{" = None" if is_flag else ""}' + return f"{type}{' = None' if is_flag else ''}" def sort_args(args: list[tuple[str, str]]): @@ -365,7 +365,7 @@ def start() -> None: # noqa: C901 arg_docs = arg_docs["params"].get(arg_name, "N/A") if arg_docs else "N/A" docstring_args.append( - f'{arg_name} ({get_docstring_arg_type(arg_type)}{", *optional*" if is_optional else ""}):\n {arg_docs}\n', + f"{arg_name} ({get_docstring_arg_type(arg_type)}{', *optional*' if is_optional else ''}):\n {arg_docs}\n", ) if c.section == "types": @@ -461,10 +461,10 @@ def start() -> None: # noqa: C901 write_types += "\n " write_types += f"if self.{arg_name} is not None:\n " - write_types += f'b.write(Vector(self.{arg_name}{f", {sub_type.title()}" if sub_type in CORE_TYPES else ""}))\n ' + write_types += f"b.write(Vector(self.{arg_name}{f', {sub_type.title()}' if sub_type in CORE_TYPES else ''}))\n " read_types += "\n " - read_types += f'{arg_name} = TLObject.read(b{f", {sub_type.title()}" if sub_type in CORE_TYPES else ""}) if flags{number} & (1 << {index}) else []\n ' + read_types += f"{arg_name} = TLObject.read(b{f', {sub_type.title()}' if sub_type in CORE_TYPES else ''}) if flags{number} & (1 << {index}) else []\n " else: write_types += "\n " write_types += f"if self.{arg_name} is not None:\n " @@ -486,10 +486,10 @@ def start() -> None: # noqa: C901 elif "vector" in arg_type.lower(): sub_type = arg_type.split("<")[1][:-1] - write_types += f'b.write(Vector(self.{arg_name}{f", {sub_type.title()}" if sub_type in CORE_TYPES else ""}))\n ' + write_types += f"b.write(Vector(self.{arg_name}{f', {sub_type.title()}' if sub_type in CORE_TYPES else ''}))\n " read_types += "\n " - read_types += f'{arg_name} = TLObject.read(b{f", {sub_type.title()}" if sub_type in CORE_TYPES else ""})\n ' + read_types += f"{arg_name} = TLObject.read(b{f', {sub_type.title()}' if sub_type in CORE_TYPES else ''})\n " else: write_types += f"b.write(self.{arg_name}.write())\n " diff --git a/compiler/docs/compiler.py b/compiler/docs/compiler.py index 7af8d45e..4b6bf041 100644 --- a/compiler/docs/compiler.py +++ b/compiler/docs/compiler.py @@ -83,7 +83,7 @@ def build(path, level=0) -> None: for k, v in sorted(all_entities.items()): v = sorted(v) - entities = [f'{i} <{snake(i).replace("_", "-")}>' for i in v] + entities = [f"{i} <{snake(i).replace('_', '-')}>" for i in v] if k != base: inner_path = base + "/" + k + "/index" + ".rst" diff --git a/pyrogram/storage/sqlite_storage.py b/pyrogram/storage/sqlite_storage.py index 14122d39..0eb46f36 100644 --- a/pyrogram/storage/sqlite_storage.py +++ b/pyrogram/storage/sqlite_storage.py @@ -149,7 +149,7 @@ async def update_usernames(self, usernames: list[tuple[int, str]]) -> None: (user[0],), ) await self.conn.executemany( - "REPLACE INTO usernames (peer_id, id)" "VALUES (?, ?)", + "REPLACE INTO usernames (peer_id, id)VALUES (?, ?)", usernames, )