diff --git a/.github/workflows/python-lint.yml b/.github/workflows/python-lint.yml index 9aec0238..7d1390ad 100644 --- a/.github/workflows/python-lint.yml +++ b/.github/workflows/python-lint.yml @@ -13,9 +13,10 @@ jobs: - uses: isort/isort-action@master with: sortPaths: "./mautrix_telegram" - - uses: psf/black@21.12b0 + - uses: psf/black@stable with: src: "./mautrix_telegram" + version: "22.1.0" - name: pre-commit run: | pip install pre-commit diff --git a/dev-requirements.txt b/dev-requirements.txt index d337c3b8..232f7249 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,3 +1,3 @@ pre-commit>=2.10.1,<3 isort>=5.10.1,<6 -black==21.12b2 +black==22.1.0 diff --git a/mautrix_telegram/formatter/from_matrix/parser.py b/mautrix_telegram/formatter/from_matrix/parser.py index 55cef8ab..daf87f3e 100644 --- a/mautrix_telegram/formatter/from_matrix/parser.py +++ b/mautrix_telegram/formatter/from_matrix/parser.py @@ -20,7 +20,7 @@ import logging from telethon import TelegramClient from mautrix.types import RoomID, UserID -from mautrix.util.formatter import MatrixParser as BaseMatrixParser, RecursionContext, HTMLNode +from mautrix.util.formatter import HTMLNode, MatrixParser as BaseMatrixParser, RecursionContext from mautrix.util.logging import TraceLogger from ... import portal as po, puppet as pu, user as u diff --git a/mautrix_telegram/portal.py b/mautrix_telegram/portal.py index b0133d94..b60be3a4 100644 --- a/mautrix_telegram/portal.py +++ b/mautrix_telegram/portal.py @@ -1512,7 +1512,7 @@ class Portal(DBPortal, BasePortal): else: w = h = None file_name = content["net.maunium.telegram.internal.filename"] - max_image_size = self.config["bridge.image_as_file_size"] * 1000 ** 2 + max_image_size = self.config["bridge.image_as_file_size"] * 1000**2 if self.config["bridge.parallel_file_transfer"] and content.url: file_handle, file_size = await util.parallel_transfer_to_telegram( @@ -2275,7 +2275,7 @@ class Portal(DBPortal, BasePortal): attrs = self._parse_telegram_document_attributes(document.attributes) - if document.size > self.config["bridge.max_document_size"] * 1000 ** 2: + if document.size > self.config["bridge.max_document_size"] * 1000**2: name = attrs.name or "" caption = f"\n{evt.message}" if evt.message else "" # TODO encrypt diff --git a/mautrix_telegram/tgclient.py b/mautrix_telegram/tgclient.py index 5c99295e..0fa2448f 100644 --- a/mautrix_telegram/tgclient.py +++ b/mautrix_telegram/tgclient.py @@ -40,7 +40,7 @@ class MautrixTelegramClient(TelegramClient): mime_type: str = None, attributes: List[TypeDocumentAttribute] = None, file_name: str = None, - max_image_size: float = 10 * 1000 ** 2, + max_image_size: float = 10 * 1000**2, ) -> Union[InputMediaUploadedDocument, InputMediaUploadedPhoto]: file_handle = await super().upload_file(file, file_name=file_name) diff --git a/pyproject.toml b/pyproject.toml index af107ec4..5220b76d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,4 +9,4 @@ line_length = 99 [tool.black] line-length = 99 target-version = ["py38"] -required-version = "21.12b0" +required-version = "22.1.0"