diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 849f2ad..11bded0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,11 +20,11 @@ repos: - id: tox-ini-fmt args: ["-p", "fix"] - repo: https://github.com/tox-dev/pyproject-fmt - rev: "2.4.3" + rev: "v2.4.3" hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.7.0" + rev: "v0.7.1" hooks: - id: ruff-format - id: ruff diff --git a/src/pipdeptree/_discovery.py b/src/pipdeptree/_discovery.py index 09e290c..33f0fbc 100644 --- a/src/pipdeptree/_discovery.py +++ b/src/pipdeptree/_discovery.py @@ -120,7 +120,7 @@ def render_duplicated_dist_metadata_text( print( # noqa: T201 ( f" {dist.metadata['Name']:<32} {dist.version:<16} (using {first_seen.version}," - f" \"{first_seen.locate_file('')}\")" + f' "{first_seen.locate_file("")}")' ), file=sys.stderr, ) diff --git a/src/pipdeptree/_models/package.py b/src/pipdeptree/_models/package.py index c62dd27..7e49250 100644 --- a/src/pipdeptree/_models/package.py +++ b/src/pipdeptree/_models/package.py @@ -50,7 +50,7 @@ class Package(ABC): if len(license_strs) == 0: return self.UNKNOWN_LICENSE_STR - return f'({", ".join(license_strs)})' + return f"({', '.join(license_strs)})" @abstractmethod def render_as_root(self, *, frozen: bool) -> str: diff --git a/tests/conftest.py b/tests/conftest.py index 9775ada..c2ec5d6 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -77,7 +77,7 @@ def fake_dist(tmp_path: Path) -> Path: fake_dist_path.mkdir(parents=True) fake_metadata = Path(fake_dist_path) / "METADATA" with fake_metadata.open("w", encoding=locale.getpreferredencoding(False)) as f: - f.write("Metadata-Version: 2.3\n" "Name: bar\n" "Version: 2.4.5\n") + f.write("Metadata-Version: 2.3\nName: bar\nVersion: 2.4.5\n") return fake_dist_path diff --git a/tests/test_discovery.py b/tests/test_discovery.py index 8a897e3..7e94fe5 100644 --- a/tests/test_discovery.py +++ b/tests/test_discovery.py @@ -24,7 +24,7 @@ def test_local_only(tmp_path: Path, mocker: MockerFixture, capfd: pytest.Capture fake_dist.mkdir() fake_metadata = Path(fake_dist) / "METADATA" with fake_metadata.open("w") as f: - f.write("Metadata-Version: 2.3\n" "Name: foo\n" "Version: 1.2.5\n") + f.write("Metadata-Version: 2.3\nName: foo\nVersion: 1.2.5\n") cmd = [str(result.creator.exe.parent / "python3"), "--local-only"] mocker.patch("pipdeptree._discovery.sys.prefix", venv_path) diff --git a/tests/test_non_host.py b/tests/test_non_host.py index 54ba7fb..c33cc86 100644 --- a/tests/test_non_host.py +++ b/tests/test_non_host.py @@ -147,7 +147,7 @@ def test_custom_interpreter_ensure_pythonpath_envar_is_honored( fake_dist.mkdir(parents=True) fake_metadata = fake_dist / "METADATA" with fake_metadata.open("w") as f: - f.write("Metadata-Version: 2.3\n" "Name: foo\n" "Version: 1.2.3\n") + f.write("Metadata-Version: 2.3\nName: foo\nVersion: 1.2.3\n") cmd = ["", f"--python={result.creator.exe}", "--all", "--depth", "0"] mocker.patch("pipdeptree._discovery.sys.argv", cmd) monkeypatch.setenv("PYTHONPATH", str(another_path))