diff --git a/python/database_cli.py b/python/database_cli.py index e28c19b..f89fc3d 100644 --- a/python/database_cli.py +++ b/python/database_cli.py @@ -48,10 +48,7 @@ class DatabaseConfig: def alembic_config(self) -> Config: """Build an alembic Config for this database.""" - # Runtime import needed — Config is in TYPE_CHECKING for the return type annotation - from alembic.config import Config as AlembicConfig # noqa: PLC0415 - - cfg = AlembicConfig() + cfg = Config() cfg.set_main_option("script_location", self.script_location) cfg.set_main_option("file_template", self.file_template) cfg.set_main_option("prepend_sys_path", ".") diff --git a/python/installer/__main__.py b/python/installer/__main__.py index 96c4937..2dc5c92 100644 --- a/python/installer/__main__.py +++ b/python/installer/__main__.py @@ -262,6 +262,7 @@ def installer( ): run(command, check=True, stdin=test.stdout) + # Fixed mount point for the new system; the installer runs as root on a fresh disk mnt_dir = "/tmp/nix_install" # noqa: S108 Path(mnt_dir).mkdir(parents=True, exist_ok=True) diff --git a/python/installer/old_installer.py b/python/installer/old_installer.py index 38be8ec..8dd9214 100644 --- a/python/installer/old_installer.py +++ b/python/installer/old_installer.py @@ -297,6 +297,7 @@ def installer( check=True, ) + # Fixed mount point for the new system; the installer runs as root on a fresh disk mnt_dir = "/tmp/nix_install" # noqa: S108 Path(mnt_dir).mkdir(parents=True, exist_ok=True) diff --git a/python/tools/audiobook/audible_convert.py b/python/tools/audiobook/audible_convert.py index 4957b04..fb64be6 100644 --- a/python/tools/audiobook/audible_convert.py +++ b/python/tools/audiobook/audible_convert.py @@ -451,7 +451,7 @@ def convert_aax_file_with_agent(aax_file: Path, config: ConversionConfig) -> Non destination.parent.mkdir(parents=True, exist_ok=True) try: temp_file.replace(destination) - except Exception as error: # noqa: BLE001 + except OSError as error: write_review_file( destination=destination, ffprobe_metadata=ffprobe_metadata, diff --git a/tests/test_audible_convert.py b/tests/test_audible_convert.py index 28e9c5f..d3b9fae 100644 --- a/tests/test_audible_convert.py +++ b/tests/test_audible_convert.py @@ -1021,8 +1021,6 @@ def test_existing_destination_skips_rename_and_removes_temp(tmp_path, monkeypatc def test_richie_exports_audiobook_models() -> None: - from python.orm.richie import Audiobook # noqa: PLC0415 - assert Audiobook.__tablename__ == "audiobook" diff --git a/tests/test_parallelize.py b/tests/test_parallelize.py index 8627164..8225c55 100644 --- a/tests/test_parallelize.py +++ b/tests/test_parallelize.py @@ -19,7 +19,7 @@ if TYPE_CHECKING: class MockFuture(Future): """MockFuture.""" - def __init__(self, result: Any) -> None: # noqa: ANN401 + def __init__(self, result: Any) -> None: """Init.""" super().__init__() self._result = result @@ -31,7 +31,7 @@ class MockFuture(Future): logging.debug(f"{timeout}=") return self._exception - def result(self, timeout: float | None = None) -> Any: # noqa: ANN401 + def result(self, timeout: float | None = None) -> Any: """Result.""" logging.debug(f"{timeout}=") return self._result @@ -40,11 +40,11 @@ class MockFuture(Future): class MockPoolExecutor(ThreadPoolExecutor): """MockPoolExecutor.""" - def __init__(self, *args: Any, **kwargs: Any) -> None: # noqa: ANN401 + def __init__(self, *args: Any, **kwargs: Any) -> None: """Initializes a new ThreadPoolExecutor instance.""" super().__init__(*args, **kwargs) - def submit(self, fn: Callable[..., Any], /, *args: Any, **kwargs: Any) -> Future: # noqa: ANN401 + def submit(self, fn: Callable[..., Any], /, *args: Any, **kwargs: Any) -> Future: """Submits a callable to be executed with the given arguments. Args: