From fa87d85708331ad45f28906217f94937bae474fe Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 1 Mar 2022 01:45:08 +1100 Subject: Fix (some) mypy things (#996) * Fix mypy things * Fix flake8 Co-authored-by: Daniel Girtler --- archinstall/lib/disk/filesystem.py | 1 + archinstall/lib/disk/helpers.py | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'archinstall/lib/disk') diff --git a/archinstall/lib/disk/filesystem.py b/archinstall/lib/disk/filesystem.py index 4f1b4217..25e251c2 100644 --- a/archinstall/lib/disk/filesystem.py +++ b/archinstall/lib/disk/filesystem.py @@ -7,6 +7,7 @@ from typing import Optional, Dict, Any, TYPE_CHECKING # https://stackoverflow.com/a/39757388/929999 if TYPE_CHECKING: from .blockdevice import BlockDevice + _: Any from .partition import Partition from .validators import valid_fs_type diff --git a/archinstall/lib/disk/helpers.py b/archinstall/lib/disk/helpers.py index afaf9e5e..eae618fb 100644 --- a/archinstall/lib/disk/helpers.py +++ b/archinstall/lib/disk/helpers.py @@ -1,7 +1,7 @@ from __future__ import annotations import json import logging -import os +import os # type: ignore import pathlib import re import time @@ -10,7 +10,7 @@ from typing import Union, List, Iterator, Dict, Optional, Any, TYPE_CHECKING # https://stackoverflow.com/a/39757388/929999 if TYPE_CHECKING: from .partition import Partition - + from .blockdevice import BlockDevice from .dmcryptdev import DMCryptDev from .mapperdev import MapperDev @@ -206,7 +206,7 @@ def all_disks() -> List[BlockDevice]: log(f"[Deprecated] archinstall.all_disks() is deprecated. Use archinstall.all_blockdevices() with the appropriate filters instead.", level=logging.WARNING, fg="yellow") return all_blockdevices(partitions=False, mappers=False) -def all_blockdevices(mappers=False, partitions=False, error=False) -> List[BlockDevice, Partition]: +def all_blockdevices(mappers=False, partitions=False, error=False) -> Dict[str, Any]: """ Returns BlockDevice() and Partition() objects for all available devices. """ @@ -237,7 +237,7 @@ def all_blockdevices(mappers=False, partitions=False, error=False) -> List[Block raise error information = enrich_blockdevice_information(information) - + for path, path_info in information.items(): if path_info.get('DMCRYPT_NAME'): instances[path] = DMCryptDev(dev_path=path) -- cgit v1.2.3-70-g09d2