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

[pre-commit.ci] pre-commit autoupdate #1563

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ repos:
- id: trailing-whitespace
- id: check-yaml
- repo: https://github.com/tox-dev/pyproject-fmt
rev: "2.2.4"
rev: "v2.5.0"
hooks:
- id: pyproject-fmt
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.9
rev: v0.9.2
hooks:
- id: ruff
args: [ "--fix", "--unsafe-fixes", "--show-fixes", "--exit-non-zero-on-fix"]
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.11.2
rev: v1.14.1
hooks:
- id: mypy
args: ['--warn-unused-ignores', '--strict-equality','--no-implicit-optional', '--check-untyped-defs']
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
dynamic = [
"version",
Expand All @@ -41,7 +42,7 @@ dependencies = [
"packaging>=20",
"platformdirs>=2.1",
"tomli; python_version<'3.11'",
"userpath!=1.9,>=1.6",
"userpath>=1.6,!=1.9",
]
urls."Bug Tracker" = "https://github.com/pypa/pipx/issues"
urls.Documentation = "https://pipx.pypa.io"
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 @@ -379,7 +379,7 @@ def package_name_from_spec(package_spec: str, python: str, *, pip_args: List[str
# will use the pypi name
package_name = pypi_name
logger.info(f"Determined package name: {package_name}")
logger.info(f"Package name determined in {time.time()-start_time:.1f}s")
logger.info(f"Package name determined in {time.time() - start_time:.1f}s")
return package_name

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

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


Expand Down
2 changes: 1 addition & 1 deletion src/pipx/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def __init__(self, venv_container: VenvContainer) -> None:
self.packages = [str(p.name) for p in sorted(venv_container.iter_venv_dirs())]

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


def get_pip_args(parsed_args: Dict[str, str]) -> List[str]:
Expand Down
2 changes: 1 addition & 1 deletion src/pipx/pipx_metadata_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def _convert_legacy_metadata(self, metadata_dict: Dict[str, Any]) -> Dict[str, A
raise PipxError(
f"""
{self.venv_dir.name}: Unknown metadata version
{metadata_dict['pipx_metadata_version']}. Perhaps it was
{metadata_dict["pipx_metadata_version"]}. Perhaps it was
installed with a later version of pipx.
"""
)
Expand Down
2 changes: 1 addition & 1 deletion src/pipx/venv.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ def install_package_no_deps(self, package_or_url: str, pip_args: List[str]) -> s
def get_venv_metadata_for_package(self, package_name: str, package_extras: Set[str]) -> VenvMetadata:
data_start = time.time()
venv_metadata = inspect_venv(package_name, package_extras, self.bin_path, self.python_path, self.man_path)
logger.info(f"get_venv_metadata_for_package: {1e3*(time.time()-data_start):.0f}ms")
logger.info(f"get_venv_metadata_for_package: {1e3 * (time.time() - data_start):.0f}ms")
return venv_metadata

def update_package_metadata(
Expand Down
1 change: 1 addition & 0 deletions testdata/empty_project/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
scripts.empty-project = "empty_project.main:cli"
entry-points."pipx.run".empty-project = "empty_project.main:cli"
4 changes: 2 additions & 2 deletions tests/test_animate.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def test_delay_suppresses_output(capsys, monkeypatch):
@pytest.mark.parametrize(
"env_columns,expected_frame_message",
[
(45, f"{TEST_STRING_40_CHAR:.{45-6}}..."),
(45, f"{TEST_STRING_40_CHAR:.{45 - 6}}..."),
(46, f"{TEST_STRING_40_CHAR}"),
(47, f"{TEST_STRING_40_CHAR}"),
],
Expand All @@ -87,7 +87,7 @@ def test_line_lengths_emoji(capsys, monkeypatch, env_columns, expected_frame_mes
@pytest.mark.parametrize(
"env_columns,expected_frame_message",
[
(43, f"{TEST_STRING_40_CHAR:.{43-4}}"),
(43, f"{TEST_STRING_40_CHAR:.{43 - 4}}"),
(44, f"{TEST_STRING_40_CHAR}"),
(45, f"{TEST_STRING_40_CHAR}"),
],
Expand Down
12 changes: 6 additions & 6 deletions tests/test_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,15 +409,15 @@ def test_passed_python_and_force_flag_warning(pipx_temp_env, capsys):

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

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


@pytest.mark.parametrize(
Expand Down
Loading