From db8a889d08f4e55787a097395dec4cfd872be343 Mon Sep 17 00:00:00 2001 From: Bohdan Bobrowski Date: Fri, 23 Aug 2024 00:26:58 +0200 Subject: [PATCH] Fixing mypy errors --- .github/workflows/code_check.yml | 6 +++--- blog2epub/common/book.py | 5 ++--- blog2epub/crawlers/default.py | 4 +++- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/code_check.yml b/.github/workflows/code_check.yml index 02ea135..3d6b1cf 100644 --- a/.github/workflows/code_check.yml +++ b/.github/workflows/code_check.yml @@ -22,6 +22,6 @@ jobs: run: | poetry run ruff format . --check poetry run ruff check . -# - name: Static code analysys with mypy -# run: | -# poetry run mypy . + - name: Static code analysys with mypy + run: | + poetry run mypy . diff --git a/blog2epub/common/book.py b/blog2epub/common/book.py index 4b52589..fd1981a 100755 --- a/blog2epub/common/book.py +++ b/blog2epub/common/book.py @@ -10,9 +10,8 @@ from blog2epub.common.cover import Cover from blog2epub.common.interfaces import EmptyInterface -from blog2epub.crawlers import AbstractCrawler, DefaultCrawler -from blog2epub.crawlers.default import Dirs -from blog2epub.models.book import BookModel, DirModel, ArticleModel +from blog2epub.crawlers import DefaultCrawler +from blog2epub.models.book import DirModel, ArticleModel from blog2epub.models.configuration import ConfigurationModel diff --git a/blog2epub/crawlers/default.py b/blog2epub/crawlers/default.py index b808726..3c8fddf 100644 --- a/blog2epub/crawlers/default.py +++ b/blog2epub/crawlers/default.py @@ -532,7 +532,9 @@ def download_image(self, img: str) -> Optional[str]: ): picture.thumbnail(self.images_size, Image.LANCZOS) # type: ignore converted_picture = picture.convert("L") - converted_picture.save(resized_fn, format="JPEG", quality=self.images_quality) + converted_picture.save( + resized_fn, format="JPEG", quality=self.images_quality + ) os.remove(original_fn) return img_hash + ".jpg" return None