Skip to content

Commit dc1d0aa

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 30dcf17 commit dc1d0aa

File tree

8 files changed

+16
-14
lines changed

8 files changed

+16
-14
lines changed

pyproject.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ classifiers = [
3131
"Programming Language :: Python :: 3.10",
3232
"Programming Language :: Python :: 3.11",
3333
"Programming Language :: Python :: 3.12",
34+
"Programming Language :: Python :: 3.13",
3435
]
3536
dynamic = [
3637
"version",
@@ -41,7 +42,7 @@ dependencies = [
4142
"packaging>=20",
4243
"platformdirs>=2.1",
4344
"tomli; python_version<'3.11'",
44-
"userpath!=1.9,>=1.6",
45+
"userpath>=1.6,!=1.9",
4546
]
4647
urls."Bug Tracker" = "https://github.com/pypa/pipx/issues"
4748
urls.Documentation = "https://pipx.pypa.io"

src/pipx/commands/common.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ def package_name_from_spec(package_spec: str, python: str, *, pip_args: List[str
379379
# will use the pypi name
380380
package_name = pypi_name
381381
logger.info(f"Determined package name: {package_name}")
382-
logger.info(f"Package name determined in {time.time()-start_time:.1f}s")
382+
logger.info(f"Package name determined in {time.time() - start_time:.1f}s")
383383
return package_name
384384

385385
# check syntax and clean up spec and pip_args
@@ -390,7 +390,7 @@ def package_name_from_spec(package_spec: str, python: str, *, pip_args: List[str
390390
venv.create_venv(venv_args=[], pip_args=[])
391391
package_name = venv.install_package_no_deps(package_or_url=package_spec, pip_args=pip_args)
392392

393-
logger.info(f"Package name determined in {time.time()-start_time:.1f}s")
393+
logger.info(f"Package name determined in {time.time() - start_time:.1f}s")
394394
return package_name
395395

396396

src/pipx/main.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def __init__(self, venv_container: VenvContainer) -> None:
163163
self.packages = [str(p.name) for p in sorted(venv_container.iter_venv_dirs())]
164164

165165
def use(self, prefix: str, **kwargs: Any) -> List[str]:
166-
return [f"{prefix}{x[len(prefix):]}" for x in self.packages if x.startswith(canonicalize_name(prefix))]
166+
return [f"{prefix}{x[len(prefix) :]}" for x in self.packages if x.startswith(canonicalize_name(prefix))]
167167

168168

169169
def get_pip_args(parsed_args: Dict[str, str]) -> List[str]:

src/pipx/pipx_metadata_file.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def _convert_legacy_metadata(self, metadata_dict: Dict[str, Any]) -> Dict[str, A
114114
raise PipxError(
115115
f"""
116116
{self.venv_dir.name}: Unknown metadata version
117-
{metadata_dict['pipx_metadata_version']}. Perhaps it was
117+
{metadata_dict["pipx_metadata_version"]}. Perhaps it was
118118
installed with a later version of pipx.
119119
"""
120120
)

src/pipx/venv.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ def install_package_no_deps(self, package_or_url: str, pip_args: List[str]) -> s
348348
def get_venv_metadata_for_package(self, package_name: str, package_extras: Set[str]) -> VenvMetadata:
349349
data_start = time.time()
350350
venv_metadata = inspect_venv(package_name, package_extras, self.bin_path, self.python_path, self.man_path)
351-
logger.info(f"get_venv_metadata_for_package: {1e3*(time.time()-data_start):.0f}ms")
351+
logger.info(f"get_venv_metadata_for_package: {1e3 * (time.time() - data_start):.0f}ms")
352352
return venv_metadata
353353

354354
def update_package_metadata(

testdata/empty_project/pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ classifiers = [
2020
"Programming Language :: Python :: 3.10",
2121
"Programming Language :: Python :: 3.11",
2222
"Programming Language :: Python :: 3.12",
23+
"Programming Language :: Python :: 3.13",
2324
]
2425
scripts.empty-project = "empty_project.main:cli"
2526
entry-points."pipx.run".empty-project = "empty_project.main:cli"

tests/test_animate.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def test_delay_suppresses_output(capsys, monkeypatch):
6666
@pytest.mark.parametrize(
6767
"env_columns,expected_frame_message",
6868
[
69-
(45, f"{TEST_STRING_40_CHAR:.{45-6}}..."),
69+
(45, f"{TEST_STRING_40_CHAR:.{45 - 6}}..."),
7070
(46, f"{TEST_STRING_40_CHAR}"),
7171
(47, f"{TEST_STRING_40_CHAR}"),
7272
],
@@ -87,7 +87,7 @@ def test_line_lengths_emoji(capsys, monkeypatch, env_columns, expected_frame_mes
8787
@pytest.mark.parametrize(
8888
"env_columns,expected_frame_message",
8989
[
90-
(43, f"{TEST_STRING_40_CHAR:.{43-4}}"),
90+
(43, f"{TEST_STRING_40_CHAR:.{43 - 4}}"),
9191
(44, f"{TEST_STRING_40_CHAR}"),
9292
(45, f"{TEST_STRING_40_CHAR}"),
9393
],

tests/test_install.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -409,15 +409,15 @@ def test_passed_python_and_force_flag_warning(pipx_temp_env, capsys):
409409

410410
assert not run_pipx_cli(["install", "black", "--force"])
411411
captured = capsys.readouterr()
412-
assert (
413-
"--python is ignored when --force is passed." not in captured.out
414-
), "Should only print warning if both flags present"
412+
assert "--python is ignored when --force is passed." not in captured.out, (
413+
"Should only print warning if both flags present"
414+
)
415415

416416
assert not run_pipx_cli(["install", "pycowsay", "--force"])
417417
captured = capsys.readouterr()
418-
assert (
419-
"--python is ignored when --force is passed." not in captured.out
420-
), "Should not print warning if package does not exist yet"
418+
assert "--python is ignored when --force is passed." not in captured.out, (
419+
"Should not print warning if package does not exist yet"
420+
)
421421

422422

423423
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)