Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enforce new ruff rules #1469

Merged
merged 4 commits into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,20 @@ lint.extend-select = [
"C9",
"I",
"ISC",
"PERF",
"PGH",
"PLC",
"PLE",
"PLW",
"RSE",
"RUF012",
"RUF100",
"TCH",
"W",
]
lint.ignore = [
"PERF203",
]
lint.isort = { known-first-party = [
"helpers",
"package_info",
Expand Down
4 changes: 2 additions & 2 deletions src/pipx/commands/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,15 +452,15 @@ def run_post_install_actions(
expose_resources_globally("man", local_man_dir, package_metadata.man_paths, force=force)

if include_dependencies:
for _, app_paths in package_metadata.app_paths_of_dependencies.items():
for app_paths in package_metadata.app_paths_of_dependencies.values():
expose_resources_globally(
"app",
local_bin_dir,
app_paths,
force=force,
suffix=package_metadata.suffix,
)
for _, man_paths in package_metadata.man_paths_of_dependencies.items():
for man_paths in package_metadata.man_paths_of_dependencies.values():
expose_resources_globally("man", local_man_dir, man_paths, force=force)

package_summary, _ = get_venv_summary(venv_dir, package_name=package_name, new_install=True)
Expand Down
6 changes: 4 additions & 2 deletions src/pipx/commands/uninstall.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import logging
from collections.abc import Callable
from pathlib import Path
from shutil import which
from typing import List, Optional, Set
from typing import TYPE_CHECKING, List, Optional, Set

if TYPE_CHECKING:
from collections.abc import Callable

from pipx.commands.common import (
add_suffix,
Expand Down
4 changes: 2 additions & 2 deletions src/pipx/commands/upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@ def _upgrade_package(
expose_resources_globally("man", paths.ctx.man_dir, package_metadata.man_paths, force=force)

if package_metadata.include_dependencies:
for _, app_paths in package_metadata.app_paths_of_dependencies.items():
for app_paths in package_metadata.app_paths_of_dependencies.values():
expose_resources_globally(
"app",
paths.ctx.bin_dir,
app_paths,
force=force,
suffix=package_metadata.suffix,
)
for _, man_paths in package_metadata.man_paths_of_dependencies.items():
for man_paths in package_metadata.man_paths_of_dependencies.values():
expose_resources_globally("man", paths.ctx.man_dir, man_paths, force=force)

if old_version == new_version:
Expand Down
6 changes: 4 additions & 2 deletions src/pipx/venv.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
import shutil
import time
from pathlib import Path
from subprocess import CompletedProcess
from typing import Dict, Generator, List, NoReturn, Optional, Set
from typing import TYPE_CHECKING, Dict, Generator, List, NoReturn, Optional, Set

if TYPE_CHECKING:
from subprocess import CompletedProcess

try:
from importlib.metadata import Distribution, EntryPoint
Expand Down