diff --git a/pip_manage/_pip_interface.py b/pip_manage/_pip_interface.py index 212e17fe..f3053c5e 100644 --- a/pip_manage/_pip_interface.py +++ b/pip_manage/_pip_interface.py @@ -1,19 +1,19 @@ from __future__ import annotations __all__: list[str] = [ - "update_packages", - "get_outdated_packages", - "uninstall_packages", - "PIP_CMD", - "LIST_ONLY", + "COMMON_PARAMETERS", "INSTALL_ONLY", + "LIST_ONLY", + "PIP_CMD", "UNINSTALL_ONLY", - "COMMON_PARAMETERS", + "get_outdated_packages", + "uninstall_packages", + "update_packages", ] import dataclasses import json -import subprocess # nosec +import subprocess # nosec # noqa: S404 import sys from typing import TYPE_CHECKING, Final diff --git a/pip_manage/pip_review.py b/pip_manage/pip_review.py index fb0a1c40..4fb9a060 100755 --- a/pip_manage/pip_review.py +++ b/pip_manage/pip_review.py @@ -127,7 +127,7 @@ def ask(self) -> str: .strip() .casefold() ) - answer = self.last_answer if answer == "" else answer + answer = answer if answer else self.last_answer if answer in {"q", "a"}: self.cached_answer = answer diff --git a/tests/fixtures.py b/tests/fixtures.py index f89df433..f1794655 100644 --- a/tests/fixtures.py +++ b/tests/fixtures.py @@ -47,7 +47,7 @@ def _keep_pytest_handlers_during_dict_config(monkeypatch: pytest.MonkeyPatch) -> ) -@pytest.fixture() +@pytest.fixture def sample_packages() -> list[_OutdatedPackage]: return [ _OutdatedPackage("test1", "1.0.0", "1.1.0", "wheel"), @@ -55,7 +55,7 @@ def sample_packages() -> list[_OutdatedPackage]: ] -@pytest.fixture() +@pytest.fixture def sample_subprocess_output() -> bytes: # pylint: disable=C0301 return ( @@ -64,7 +64,7 @@ def sample_subprocess_output() -> bytes: ) -@pytest.fixture() +@pytest.fixture def dummy_dependencies() -> list[SimpleNamespace]: package_a: SimpleNamespace = SimpleNamespace( name="package_a",