Skip to content

Commit 5589b69

Browse files
Apply ruff/flake8-implicit-str-concat rule ISC001 (#1403)
1 parent 3c9eb2e commit 5589b69

File tree

12 files changed

+21
-22
lines changed

12 files changed

+21
-22
lines changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ lint.extend-select = [
7171
"C4",
7272
"C9",
7373
"I",
74+
"ISC",
7475
"PLC",
7576
"PLE",
7677
"PLW",

scripts/list_test_packages.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def process_command_line(argv: List[str]) -> argparse.Namespace:
3333
# required arguments
3434
parser.add_argument(
3535
"primary_package_list",
36-
help="Main packages to examine, getting list of " "matching distribution files and dependencies.",
36+
help="Main packages to examine, getting list of matching distribution files and dependencies.",
3737
)
3838
parser.add_argument("package_list_dir", help="Directory to output package distribution lists.")
3939

scripts/migrate_pipsi_to_pipx.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def main():
4141
ret = subprocess.run(["pipsi", "uninstall", "--yes", package], check=False)
4242
if ret.returncode:
4343
error = True
44-
print(f"Failed to uninstall {package!r} with pipsi. " "Not attempting to install with pipx.")
44+
print(f"Failed to uninstall {package!r} with pipsi. Not attempting to install with pipx.")
4545
else:
4646
print(f"uninstalled {package!r} with pipsi. Now attempting to install with pipx.")
4747
ret = subprocess.run(["pipx", "install", package], check=False)
@@ -52,9 +52,7 @@ def main():
5252
print(f"Successfully installed {package} with pipx")
5353

5454
print(f"Done migrating {len(packages)} packages!")
55-
print(
56-
"You may still need to run `pipsi uninstall pipsi` or `pip uninstall pipsi`. " "Refer to pipsi's documentation."
57-
)
55+
print("You may still need to run `pipsi uninstall pipsi` or `pip uninstall pipsi`. Refer to pipsi's documentation.")
5856

5957
if error:
6058
print("Note: Finished with errors. Review output to manually complete migration.")

scripts/update_package_cache.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def process_command_line(argv: List[str]) -> argparse.Namespace:
4646
"-c",
4747
"--check-only",
4848
action="store_true",
49-
help="Only check to see if needed packages are in PACKAGES_DIR, do not " "download or delete files.",
49+
help="Only check to see if needed packages are in PACKAGES_DIR, do not download or delete files.",
5050
)
5151

5252
return parser.parse_args(argv)
@@ -63,7 +63,7 @@ def update_test_packages_cache(package_list_dir_path: Path, pipx_package_cache_p
6363

6464
if not platform_package_list_path.exists():
6565
print(
66-
f"WARNING. File {platform_package_list_path!s}\n" " does not exist. Creating now...",
66+
f"WARNING. File {platform_package_list_path!s}\n does not exist. Creating now...",
6767
file=sys.stderr,
6868
)
6969
create_list_returncode = create_test_packages_list(
@@ -80,7 +80,7 @@ def update_test_packages_cache(package_list_dir_path: Path, pipx_package_cache_p
8080
)
8181
else:
8282
print(
83-
f"ERROR. Unable to create {platform_package_list_path!s}\n" " Cannot continue.\n",
83+
f"ERROR. Unable to create {platform_package_list_path!s}\n Cannot continue.\n",
8484
file=sys.stderr,
8585
)
8686
return 1
@@ -89,7 +89,7 @@ def update_test_packages_cache(package_list_dir_path: Path, pipx_package_cache_p
8989
platform_package_list_fh = platform_package_list_path.open("r")
9090
except OSError:
9191
print(
92-
f"ERROR. File {platform_package_list_path!s}\n" " is not readable. Cannot continue.\n",
92+
f"ERROR. File {platform_package_list_path!s}\n is not readable. Cannot continue.\n",
9393
file=sys.stderr,
9494
)
9595
return 1

src/pipx/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
import sys
22

33
if sys.version_info < (3, 8, 0):
4-
sys.exit("Python 3.8 or later is required. " "See https://github.com/pypa/pipx " "for installation instructions.")
4+
sys.exit("Python 3.8 or later is required. See https://github.com/pypa/pipx for installation instructions.")

src/pipx/commands/common.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def _symlink_package_resource(
155155
)
156156
return
157157
if is_symlink and not exists:
158-
logger.info(f"Removing existing symlink {symlink_path!s} since it " "pointed non-existent location")
158+
logger.info(f"Removing existing symlink {symlink_path!s} since it pointed non-existent location")
159159
symlink_path.unlink()
160160

161161
if executable:
@@ -186,22 +186,22 @@ def venv_health_check(venv: Venv, package_name: Optional[str] = None) -> Tuple[V
186186
if not python_path.is_file():
187187
return (
188188
VenvProblems(invalid_interpreter=True),
189-
f" package {red(bold(venv_dir.name))} has invalid " f"interpreter {python_path!s}\r{hazard}",
189+
f" package {red(bold(venv_dir.name))} has invalid interpreter {python_path!s}\r{hazard}",
190190
)
191191
if not venv.package_metadata:
192192
return (
193193
VenvProblems(missing_metadata=True),
194-
f" package {red(bold(venv_dir.name))} has missing " f"internal pipx metadata.\r{hazard}",
194+
f" package {red(bold(venv_dir.name))} has missing internal pipx metadata.\r{hazard}",
195195
)
196196
if venv_dir.name != canonicalize_name(venv_dir.name):
197197
return (
198198
VenvProblems(bad_venv_name=True),
199-
f" package {red(bold(venv_dir.name))} needs its " f"internal data updated.\r{hazard}",
199+
f" package {red(bold(venv_dir.name))} needs its internal data updated.\r{hazard}",
200200
)
201201
if venv.package_metadata[package_name].package_version == "":
202202
return (
203203
VenvProblems(not_installed=True),
204-
f" package {red(bold(package_name))} {red('is not installed')} " f"in the venv {venv_dir.name}\r{hazard}",
204+
f" package {red(bold(package_name))} {red('is not installed')} in the venv {venv_dir.name}\r{hazard}",
205205
)
206206
return (VenvProblems(), "")
207207

src/pipx/commands/list_packages.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def list_packages(
112112
)
113113
if all_venv_problems.invalid_interpreter:
114114
logger.warning(
115-
"\nOne or more packages have a missing python interpreter.\n" " To fix, execute: pipx reinstall-all"
115+
"\nOne or more packages have a missing python interpreter.\n To fix, execute: pipx reinstall-all"
116116
)
117117
if all_venv_problems.missing_metadata:
118118
logger.warning(

src/pipx/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,7 @@ def _add_runpip(subparsers, venv_completer: VenvCompleter, shared_parser: argpar
806806
def _add_ensurepath(subparsers: argparse._SubParsersAction, shared_parser: argparse.ArgumentParser) -> None:
807807
p = subparsers.add_parser(
808808
"ensurepath",
809-
help=("Ensure directories necessary for pipx operation are in your " "PATH environment variable."),
809+
help=("Ensure directories necessary for pipx operation are in your PATH environment variable."),
810810
description=(
811811
"Ensure directory where pipx stores apps is in your "
812812
"PATH environment variable. Also if pipx was installed via "

src/pipx/standalone_python.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def _unpack(full_version, download_link, archive: Path, download_dir: Path):
112112
expected_checksum = urlopen(checksum_link).read().decode().rstrip("\n")
113113
if checksum != expected_checksum:
114114
raise PipxError(
115-
f"Checksum mismatch for python {full_version} build. " f"Expected {expected_checksum}, got {checksum}."
115+
f"Checksum mismatch for python {full_version} build. Expected {expected_checksum}, got {checksum}."
116116
)
117117

118118
with tarfile.open(archive, mode="r:gz") as tar:

src/pipx/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ def subprocess_post_check_handle_pip_error(
343343
if completed_process.stderr is not None:
344344
print(completed_process.stderr, file=pip_error_fh, end="")
345345

346-
logger.error("Fatal error from pip prevented installation. Full pip output in file:\n" f" {pip_error_file}")
346+
logger.error(f"Fatal error from pip prevented installation. Full pip output in file:\n {pip_error_file}")
347347

348348
analyze_pip_output(completed_process.stdout, completed_process.stderr)
349349

0 commit comments

Comments
 (0)