From 9357c4632e92b24b77048c7760fc7c3ebff35968 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Tue, 9 Dec 2025 17:54:41 +0100 Subject: [PATCH] Release version 0.7.7 --- CHANGELOG.md | 5 ++ PKGBUILD | 2 +- debian/changelog | 6 +++ flake.nix | 2 +- package-manager.spec | 5 +- pyproject.toml | 2 +- tests/e2e/test_install_pkgmgr_shallow.py | 59 ++++++++++++++++-------- 7 files changed, 59 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7271c22..d85c1c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## [0.7.7] - 2025-12-09 + +* Added TEST_PATTERN parameter to execute dedicated tests + + ## [0.7.6] - 2025-12-09 * Fixed pull --preview bug in e2e test diff --git a/PKGBUILD b/PKGBUILD index 49afce9..80c5904 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,7 +1,7 @@ # Maintainer: Kevin Veen-Birkenbach pkgname=package-manager -pkgver=0.7.6 +pkgver=0.7.7 pkgrel=1 pkgdesc="Local-flake wrapper for Kevin's package-manager (Nix-based)." arch=('any') diff --git a/debian/changelog b/debian/changelog index 6e41db6..285451e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +package-manager (0.7.7-1) unstable; urgency=medium + + * Added TEST_PATTERN parameter to execute dedicated tests + + -- Kevin Veen-Birkenbach Tue, 09 Dec 2025 17:54:38 +0100 + package-manager (0.7.6-1) unstable; urgency=medium * Fixed pull --preview bug in e2e test diff --git a/flake.nix b/flake.nix index 4744b76..49aaa78 100644 --- a/flake.nix +++ b/flake.nix @@ -31,7 +31,7 @@ rec { pkgmgr = pyPkgs.buildPythonApplication { pname = "package-manager"; - version = "0.7.6"; + version = "0.7.7"; # Use the git repo as source src = ./.; diff --git a/package-manager.spec b/package-manager.spec index 61af320..2ca1f65 100644 --- a/package-manager.spec +++ b/package-manager.spec @@ -1,5 +1,5 @@ Name: package-manager -Version: 0.7.6 +Version: 0.7.7 Release: 1%{?dist} Summary: Wrapper that runs Kevin's package-manager via Nix flake @@ -77,6 +77,9 @@ echo ">>> package-manager removed. Nix itself was not removed." /usr/lib/package-manager/ %changelog +* Tue Dec 09 2025 Kevin Veen-Birkenbach - 0.7.7-1 +- Added TEST_PATTERN parameter to execute dedicated tests + * Tue Dec 09 2025 Kevin Veen-Birkenbach - 0.7.6-1 - Fixed pull --preview bug in e2e test diff --git a/pyproject.toml b/pyproject.toml index 31148f9..b9f56f5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta" [project] name = "package-manager" -version = "0.7.6" +version = "0.7.7" description = "Kevin's package-manager tool (pkgmgr)" readme = "README.md" requires-python = ">=3.11" diff --git a/tests/e2e/test_install_pkgmgr_shallow.py b/tests/e2e/test_install_pkgmgr_shallow.py index 6742116..e41a1bc 100644 --- a/tests/e2e/test_install_pkgmgr_shallow.py +++ b/tests/e2e/test_install_pkgmgr_shallow.py @@ -35,7 +35,7 @@ def remove_pkgmgr_from_nix_profile() -> None: prints a descriptive format without an index column inside the container. Instead, we directly try to remove possible names: - - 'pkgmgr' (the actual name shown in `nix profile list`) + - 'pkgmgr' (the actual name shown in `nix profile list`) - 'package-manager' (the name mentioned in Nix's own error hints) """ for spec in ("pkgmgr", "package-manager"): @@ -76,29 +76,47 @@ def pkgmgr_help_debug() -> None: print(f"returncode: {proc.returncode}") print("--- END ---\n") - if proc.returncode != 0: - raise AssertionError(f"'pkgmgr --help' failed with exit code {proc.returncode}") - - # Wichtig: Hier KEIN AssertionError mehr – das ist reine Debug-Ausgabe. - # Falls du später hart testen willst, kannst du optional: - # if proc.returncode != 0: - # self.fail("...") - # aber aktuell nur Sichtprüfung. + # Important: this is **debug-only**. Do NOT fail the test here. + # If you ever want to hard-assert on this, you can add an explicit + # assertion in the test method instead of here. class TestIntegrationInstalPKGMGRShallow(unittest.TestCase): def test_install_pkgmgr_self_install(self) -> None: - # Debug before cleanup - nix_profile_list_debug("BEFORE CLEANUP") + """ + End-to-end test that runs "python main.py install pkgmgr ..." inside + the test container. - # Cleanup: aggressively try to drop any pkgmgr/profile entries - remove_pkgmgr_from_nix_profile() - - # Debug after cleanup - nix_profile_list_debug("AFTER CLEANUP") + We isolate HOME into /tmp/pkgmgr-self-install so that: + - ~/.config/pkgmgr points to an isolated test config area + - ~/Repositories is owned by the current user inside the container + (avoiding Nix's 'repository path is not owned by current user' error) + """ + # Use a dedicated HOME for this test to avoid permission/ownership issues + temp_home = "/tmp/pkgmgr-self-install" + os.makedirs(temp_home, exist_ok=True) original_argv = sys.argv + original_environ = os.environ.copy() + try: + # Isolate HOME so that ~ expands to /tmp/pkgmgr-self-install + os.environ["HOME"] = temp_home + + # Optional: ensure XDG_* also use the temp HOME for extra isolation + os.environ.setdefault("XDG_CONFIG_HOME", os.path.join(temp_home, ".config")) + os.environ.setdefault("XDG_CACHE_HOME", os.path.join(temp_home, ".cache")) + os.environ.setdefault("XDG_DATA_HOME", os.path.join(temp_home, ".local", "share")) + + # Debug before cleanup + nix_profile_list_debug("BEFORE CLEANUP") + + # Cleanup: aggressively try to drop any pkgmgr/profile entries + remove_pkgmgr_from_nix_profile() + + # Debug after cleanup + nix_profile_list_debug("AFTER CLEANUP") + sys.argv = [ "python", "install", @@ -107,13 +125,18 @@ class TestIntegrationInstalPKGMGRShallow(unittest.TestCase): "shallow", "--no-verification", ] - # Führt die Installation via main.py aus + + # Run installation via main.py runpy.run_module("main", run_name="__main__") - # Nach erfolgreicher Installation: pkgmgr --help anzeigen (Debug) + # After successful installation: run `pkgmgr --help` for debug pkgmgr_help_debug() + finally: sys.argv = original_argv + # Restore full environment + os.environ.clear() + os.environ.update(original_environ) if __name__ == "__main__":