Skip to content

Commit

Permalink
style: ruff updated to 0.5.6
Browse files Browse the repository at this point in the history
  • Loading branch information
actionless committed Aug 3, 2024
1 parent ede8e4c commit 657036d
Show file tree
Hide file tree
Showing 32 changed files with 44 additions and 44 deletions.
2 changes: 1 addition & 1 deletion packaging/usr/bin/pikaur
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ except ModuleNotFoundError:
try:
from pikaur.i18n import translate
from pikaur.main import main
from pikaur.pprint import print_warning
from pikaur.pikaprint import print_warning
except: # noqa: E722
print("System Python had breaking version update. You need to rebuild Pikaur manually.")
print()
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion pikaur/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from pprint import pformat
from typing import TYPE_CHECKING

from .argparse import ArgumentParserWithUnknowns
from .argparse_extras import ArgumentParserWithUnknowns
from .config import PikaurConfig
from .i18n import translate, translate_many

Expand Down
2 changes: 1 addition & 1 deletion pikaur/aur.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from .aur_types import AurBaseUrl, AURPackageInfo
from .exceptions import AURError
from .logging import create_logger
from .logging_extras import create_logger
from .progressbar import ThreadSafeProgressBar
from .provider import Provider
from .urllib_helper import get_gzip_from_url, get_json_from_url
Expand Down
4 changes: 2 additions & 2 deletions pikaur/aur_deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
PackagesNotFoundInRepoError,
)
from .i18n import translate
from .logging import create_logger
from .logging_extras import create_logger
from .pacman import PackageDB
from .pprint import print_error
from .pikaprint import print_error
from .version import VersionMatcher

if TYPE_CHECKING:
Expand Down
4 changes: 2 additions & 2 deletions pikaur/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@
)
from .filelock import FileLock
from .i18n import translate, translate_many
from .logging import create_logger
from .logging_extras import create_logger
from .makepkg_config import MakePkgCommand, MakepkgConfig, get_pkgdest
from .pacman import PackageDB, get_pacman_command, install_built_deps
from .pprint import (
from .pikaprint import (
ColorsHighlight,
TTYRestoreContext,
bold_line,
Expand Down
2 changes: 1 addition & 1 deletion pikaur/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

from .args import parse_args
from .i18n import translate
from .pprint import ColorsHighlight, bold_line, color_line, print_error, print_stderr
from .pikaprint import ColorsHighlight, bold_line, color_line, print_error, print_stderr
from .privilege import sudo

if TYPE_CHECKING:
Expand Down
2 changes: 1 addition & 1 deletion pikaur/filelock.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from typing import TYPE_CHECKING

from .core import DEFAULT_INPUT_ENCODING
from .logging import create_logger
from .logging_extras import create_logger

if TYPE_CHECKING:
from typing import Final, TextIO
Expand Down
2 changes: 1 addition & 1 deletion pikaur/getpkgbuild_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from .exceptions import PackagesNotFoundInRepoError
from .i18n import translate
from .pacman import PackageDB
from .pprint import print_stdout
from .pikaprint import print_stdout
from .print_department import print_not_found_packages
from .urllib_helper import wrap_proxy_env

Expand Down
2 changes: 1 addition & 1 deletion pikaur/help_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from .config import PikaurConfig
from .core import spawn
from .i18n import PIKAUR_NAME, translate
from .pprint import print_stdout
from .pikaprint import print_stdout

if TYPE_CHECKING:
from typing import Final
Expand Down
2 changes: 1 addition & 1 deletion pikaur/info_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from .i18n import translate
from .pacman import get_pacman_command, refresh_pkg_db_if_needed
from .pacman_i18n import _p
from .pprint import ColorsHighlight, bold_line, color_line, print_stdout
from .pikaprint import ColorsHighlight, bold_line, color_line, print_stdout


def _info_packages_thread_repo() -> str | None:
Expand Down
6 changes: 3 additions & 3 deletions pikaur/install_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
)
from .i18n import translate
from .install_info_fetcher import InstallInfoFetcher
from .logging import create_logger
from .logging_extras import create_logger
from .news import News
from .pacman import (
PackageDB,
Expand All @@ -41,7 +41,7 @@
refresh_pkg_db_if_needed,
strip_repo_name,
)
from .pprint import (
from .pikaprint import (
ColorsHighlight,
TTYRestoreContext,
bold_line,
Expand Down Expand Up @@ -1072,7 +1072,7 @@ def handle_pkgbuild_changed(self, pkg_build: PackageBuild) -> None:
self.main_sequence()
raise self.ExitMainSequence

def build_packages(self) -> None: # pylint: disable=too-many-branches
def build_packages(self) -> None: # pylint: disable=too-many-branches,too-many-statements
logger.debug("<< BUILD PACKAGES")
if self.args.needed or self.args.devel:
self._get_installed_status()
Expand Down
4 changes: 2 additions & 2 deletions pikaur/install_info_fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
from .core import AURInstallInfo, ComparableType, PackageSource, RepoInstallInfo
from .exceptions import DependencyError, DependencyVersionMismatchError, SysExit
from .i18n import translate
from .logging import create_logger
from .logging_extras import create_logger
from .pacman import (
PackageDB,
find_sysupgrade_packages,
get_ignored_pkgnames_from_patterns,
get_pacman_command,
strip_repo_name,
)
from .pprint import print_error, print_stderr, print_stdout
from .pikaprint import print_error, print_stderr, print_stdout
from .print_department import print_ignored_package, print_not_found_packages
from .prompt import ask_to_continue
from .replacements import find_replacements
Expand Down
2 changes: 1 addition & 1 deletion pikaur/logging.py → pikaur/logging_extras.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from .args import parse_args
from .i18n import translate
from .pprint import Colors, ColorsHighlight, color_line, print_stderr
from .pikaprint import Colors, ColorsHighlight, color_line, print_stderr

if TYPE_CHECKING:
from typing import Any, Final
Expand Down
4 changes: 2 additions & 2 deletions pikaur/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@
from .i18n import translate
from .info_cli import cli_info_packages
from .install_cli import InstallPackagesCLI
from .logging import create_logger
from .logging_extras import create_logger
from .pacman import PackageDB
from .pikaprint import TTYRestore, bold_line, print_error, print_stderr, print_warning
from .pikspect import PikspectSignalHandler
from .pkg_cache_cli import cli_clean_packages_cache
from .pprint import TTYRestore, bold_line, print_error, print_stderr, print_warning
from .print_department import print_version
from .privilege import (
get_args_to_elevate_pikaur,
Expand Down
4 changes: 2 additions & 2 deletions pikaur/news.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
from .config import CacheRoot, PikaurConfig
from .core import DEFAULT_TIMEZONE, open_file
from .i18n import translate
from .logging import create_logger
from .logging_extras import create_logger
from .pacman import PackageDB
from .pprint import (
from .pikaprint import (
BOLD_RESET,
BOLD_START,
COLOR_RESET,
Expand Down
4 changes: 2 additions & 2 deletions pikaur/pacman.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
from .exceptions import DependencyError, PackagesNotFoundInRepoError
from .i18n import translate
from .lock import FancyLock
from .logging import create_logger
from .logging_extras import create_logger
from .pacman_i18n import _p
from .pprint import color_enabled, print_error, print_stderr
from .pikaprint import color_enabled, print_error, print_stderr
from .privilege import sudo
from .prompt import retry_interactive_command, retry_interactive_command_or_exit
from .provider import Provider
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions pikaur/pikspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
from .args import parse_args
from .core import DEFAULT_INPUT_ENCODING
from .i18n import translate
from .logging import create_logger
from .logging_extras import create_logger
from .pacman_i18n import _p
from .pprint import (
from .pikaprint import (
ColorsHighlight,
PrintLock,
TTYRestore,
Expand Down Expand Up @@ -56,7 +56,7 @@


def file_debug(message: "Any") -> None:
# @TODO: move it to the logging module
# @TODO: move it to the logging_extras module
if FILE_DEBUG:
with Path("./pikspect_debug.txt").open("a", encoding=DEFAULT_INPUT_ENCODING) as fobj:
fobj.write(str(message) + "\n")
Expand Down
4 changes: 2 additions & 2 deletions pikaur/pkg_cache_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
from .core import interactive_spawn, remove_dir
from .exceptions import SysExit
from .i18n import translate
from .logging import create_logger
from .logging_extras import create_logger
from .pikaprint import ColorsHighlight, bold_line, color_line, print_stdout
from .pikspect import YesNo, format_pacman_question, pikspect
from .pprint import ColorsHighlight, bold_line, color_line, print_stdout
from .privilege import sudo
from .prompt import ask_to_continue

Expand Down
2 changes: 1 addition & 1 deletion pikaur/print_department.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from .config import VERSION, AurSearchSortingValues, PikaurConfig, UpgradeSortingValues
from .core import DEFAULT_TIMEZONE, InstallInfo
from .i18n import translate, translate_many
from .pprint import (
from .pikaprint import (
Colors,
ColorsHighlight,
bold_line,
Expand Down
2 changes: 1 addition & 1 deletion pikaur/progressbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from threading import Lock
from typing import TYPE_CHECKING, ClassVar

from .pprint import color_enabled, get_term_width
from .pikaprint import color_enabled, get_term_width

if TYPE_CHECKING:
from collections.abc import Callable
Expand Down
8 changes: 4 additions & 4 deletions pikaur/prompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@
from .exceptions import SysExit
from .filelock import FileLock
from .i18n import translate
from .logging import create_logger
from .pikspect import PikspectPopen, ReadlineKeycodes, TTYInputWrapper
from .pikspect import pikspect as pikspect_spawn
from .pprint import (
from .logging_extras import create_logger
from .pikaprint import (
ColorsHighlight,
TTYRestoreContext,
color_line,
Expand All @@ -24,6 +22,8 @@
print_warning,
range_printable,
)
from .pikspect import PikspectPopen, ReadlineKeycodes, TTYInputWrapper
from .pikspect import pikspect as pikspect_spawn
from .privilege import isolate_root_cmd

if TYPE_CHECKING:
Expand Down
2 changes: 1 addition & 1 deletion pikaur/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from .aur_types import AURPackageInfo
from .i18n import translate
from .pprint import Colors, bold_line, color_line, print_error, print_stdout
from .pikaprint import Colors, bold_line, color_line, print_error, print_stdout
from .print_department import print_package_search_results
from .prompt import NotANumberInputError, get_multiple_numbers_input
from .version import VersionMatcher
Expand Down
2 changes: 1 addition & 1 deletion pikaur/replacements.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from .exceptions import PackagesNotFoundInRepoError
from .i18n import translate_many
from .pacman import PackageDB
from .pprint import print_warning
from .pikaprint import print_warning


def find_replacements() -> dict[str, list[str]]:
Expand Down
2 changes: 1 addition & 1 deletion pikaur/search_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from .exceptions import AURError, SysExit
from .i18n import translate
from .pacman import PackageDB, get_pkg_id, refresh_pkg_db_if_needed
from .pprint import print_error, print_stderr
from .pikaprint import print_error, print_stderr
from .print_department import print_package_search_results

if TYPE_CHECKING:
Expand Down
2 changes: 1 addition & 1 deletion pikaur/srcinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from .exceptions import SysExit
from .i18n import translate
from .makepkg_config import MakePkgCommand, MakepkgConfig
from .pprint import print_error, print_stderr
from .pikaprint import print_error, print_stderr
from .privilege import isolate_root_cmd
from .version import VersionMatcher

Expand Down
2 changes: 1 addition & 1 deletion pikaur/updates.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
find_upgradeable_packages,
get_ignored_pkgnames_from_patterns,
)
from .pprint import print_stderr, print_stdout
from .pikaprint import print_stderr, print_stdout
from .print_department import (
pretty_format_upgradeable,
print_ignored_package,
Expand Down
2 changes: 1 addition & 1 deletion pikaur/urllib_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from .config import PikaurConfig
from .exceptions import SysExit
from .i18n import translate
from .pprint import ColorsHighlight, color_line, print_error, print_stderr
from .pikaprint import ColorsHighlight, color_line, print_error, print_stderr
from .prompt import ask_to_continue

if TYPE_CHECKING:
Expand Down
2 changes: 1 addition & 1 deletion pikaur_meta_helpers/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import sys

from pikaur.exceptions import SysExit
from pikaur.pprint import print_error, print_stdout
from pikaur.pikaprint import print_error, print_stdout
from pikaur.prompt import NotANumberInputError, get_multiple_numbers_input


Expand Down
2 changes: 1 addition & 1 deletion pikaur_test/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from pikaur.main import main
from pikaur.makepkg_config import MakePkgCommand
from pikaur.pacman import PackageDB
from pikaur.pprint import color_line, get_term_width
from pikaur.pikaprint import color_line, get_term_width
from pikaur.srcinfo import SrcInfo

if TYPE_CHECKING:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ ignore = [
]

[tool.ruff.lint.per-file-ignores]
"pikaur/argparse.py" = [
"pikaur/argparse_extras.py" = [
"PLR0912",
"PLR0915",
"SLF001",
Expand Down

0 comments on commit 657036d

Please sign in to comment.