style: autoformat src and tests

Repository-wide formatting pass over src/ and tests/: sorted imports and
__all__ entries, dropped redundant `# -*- coding: utf-8 -*-` headers,
unquoted forward-reference annotations (safe under
`from __future__ import annotations`), merged nested `with` statements,
moved `Iterable` and friends from `typing` to `collections.abc`, and
removed `# noqa: F401` markers that no longer suppress anything.

No behavioural changes. Unit and integration suites show the same four
pre-existing failures before and after the pass.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Kevin Veen-Birkenbach
2026-07-27 15:17:35 +02:00
parent f1517963a5
commit 8294bce436
185 changed files with 378 additions and 445 deletions

View File

@@ -4,7 +4,7 @@ import io
import runpy
import sys
import unittest
from contextlib import redirect_stdout, redirect_stderr
from contextlib import redirect_stderr, redirect_stdout
def _run_pkgmgr_help(argv_tail: list[str]) -> str:

View File

@@ -6,8 +6,8 @@ import sys
import unittest
from test_version_commands import (
_load_pkgmgr_repo_dir,
PROJECT_ROOT,
_load_pkgmgr_repo_dir,
)

View File

@@ -16,8 +16,8 @@ import unittest
from test_install_pkgmgr_shallow import (
nix_profile_list_debug,
remove_pkgmgr_from_nix_profile,
pkgmgr_help_debug,
remove_pkgmgr_from_nix_profile,
)

View File

@@ -1,5 +1,4 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Integration tests for the `pkgmgr config` command.

View File

@@ -1,8 +1,9 @@
from tests.e2e._util import run
import tempfile
import unittest
from pathlib import Path
from tests.e2e._util import run
class TestMakefileThreeTimes(unittest.TestCase):
def test_make_install_three_times(self):

View File

@@ -1,8 +1,8 @@
import runpy
import sys
import os
import unittest
import runpy
import subprocess
import sys
import unittest
def nix_profile_list_debug(label: str) -> None:

View File

@@ -1,9 +1,10 @@
import os
from tests.e2e._util import run
import tempfile
import unittest
from pathlib import Path
from tests.e2e._util import run
class TestPkgmgrInstallThreeTimesNix(unittest.TestCase):
def test_three_times_install_nix(self):

View File

@@ -1,8 +1,9 @@
from tests.e2e._util import run
import os
import tempfile
import unittest
from pathlib import Path
import os
from tests.e2e._util import run
class TestPkgmgrInstallThreeTimesVenv(unittest.TestCase):

View File

@@ -1,5 +1,4 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Integration tests for the `pkgmgr make` command.

View File

@@ -1,5 +1,4 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
E2E test to inspect the Nix environment and build the pkgmgr flake
@@ -22,7 +21,6 @@ import os
import subprocess
import unittest
# Resolve project root (the repo where flake.nix lives, e.g. /src)
PROJECT_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", ".."))

View File

@@ -1,5 +1,4 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
End-to-end tests for the `pkgmgr path` command.

View File

@@ -5,7 +5,6 @@ import shutil
import subprocess
import unittest
PROJECT_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", ".."))

View File

@@ -1,5 +1,4 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
End-to-end style integration tests for the `pkgmgr release` CLI command.
@@ -141,8 +140,8 @@ class TestIntegrationReleaseCommand(unittest.TestCase):
This test intentionally does not mock anything to exercise the real
CLI parser wiring in main.py.
"""
import io
import contextlib
import io
original_argv = list(sys.argv)
buf = io.StringIO()

View File

@@ -1,5 +1,4 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Integration tests for the "tools" commands:

View File

@@ -22,8 +22,8 @@ from pathlib import Path
from test_install_pkgmgr_shallow import (
nix_profile_list_debug,
remove_pkgmgr_from_nix_profile,
pkgmgr_help_debug,
remove_pkgmgr_from_nix_profile,
)

View File

@@ -21,8 +21,8 @@ from pathlib import Path
from test_install_pkgmgr_shallow import (
nix_profile_list_debug,
remove_pkgmgr_from_nix_profile,
pkgmgr_help_debug,
remove_pkgmgr_from_nix_profile,
)

View File

@@ -1,5 +1,4 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
End-to-end tests for the `pkgmgr version` command.