Release version 0.7.10

This commit is contained in:
Kevin Veen-Birkenbach
2025-12-09 22:57:11 +01:00
parent 78693225f1
commit 78e5985caf
8 changed files with 51 additions and 24 deletions

View File

@@ -1,3 +1,8 @@
## [0.7.10] - 2025-12-09
* Fixed test_install_pkgmgr_shallow.py
## [0.7.9] - 2025-12-09
* 'main' and 'master' are now both accepted as branches for branch close merge

View File

@@ -1,7 +1,7 @@
# Maintainer: Kevin Veen-Birkenbach <info@veen.world>
pkgname=package-manager
pkgver=0.7.9
pkgver=0.7.10
pkgrel=1
pkgdesc="Local-flake wrapper for Kevin's package-manager (Nix-based)."
arch=('any')

6
debian/changelog vendored
View File

@@ -1,3 +1,9 @@
package-manager (0.7.10-1) unstable; urgency=medium
* Fixed test_install_pkgmgr_shallow.py
-- Kevin Veen-Birkenbach <kevin@veen.world> Tue, 09 Dec 2025 22:57:08 +0100
package-manager (0.7.9-1) unstable; urgency=medium
* 'main' and 'master' are now both accepted as branches for branch close merge

View File

@@ -31,7 +31,7 @@
rec {
pkgmgr = pyPkgs.buildPythonApplication {
pname = "package-manager";
version = "0.7.9";
version = "0.7.10";
# Use the git repo as source
src = ./.;

View File

@@ -1,5 +1,5 @@
Name: package-manager
Version: 0.7.9
Version: 0.7.10
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 <kevin@veen.world> - 0.7.10-1
- Fixed test_install_pkgmgr_shallow.py
* Tue Dec 09 2025 Kevin Veen-Birkenbach <kevin@veen.world> - 0.7.9-1
- 'main' and 'master' are now both accepted as branches for branch close merge

View File

@@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "package-manager"
version = "0.7.9"
version = "0.7.10"
description = "Kevin's package-manager tool (pkgmgr)"
readme = "README.md"
requires-python = ">=3.11"

View File

@@ -13,6 +13,7 @@ dnf -y install \
bash \
curl-minimal \
ca-certificates \
sudo \
xz
dnf clean all

View File

@@ -35,8 +35,8 @@ 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`)
- 'package-manager' (the name mentioned in Nix's own error hints)
- 'pkgmgr'
- 'package-manager'
"""
for spec in ("pkgmgr", "package-manager"):
subprocess.run(
@@ -45,18 +45,34 @@ def remove_pkgmgr_from_nix_profile() -> None:
)
def configure_git_safe_directory() -> None:
"""
Configure Git to treat /src as a safe directory.
Needed because /src is a bind-mounted repository in CI, often owned by a
different UID. Modern Git aborts with:
'fatal: detected dubious ownership in repository at /src/.git'
This fix applies ONLY inside this test container.
"""
try:
subprocess.run(
["git", "config", "--global", "--add", "safe.directory", "/src"],
check=False,
)
except FileNotFoundError:
print("[WARN] git not found skipping safe.directory configuration")
def pkgmgr_help_debug() -> None:
"""
Run `pkgmgr --help` after installation *inside an interactive bash shell*,
print its output and return code, but never fail the test.
Reason:
- The installer adds venv/alias setup into shell rc files (~/.bashrc, ~/.zshrc)
- Those changes are only applied in a new interactive shell session.
This ensures the installers shell RC changes are actually loaded.
"""
print("\n--- PKGMGR HELP (after installation, via bash -i) ---")
# Simulate a fresh interactive bash, so ~/.bashrc gets sourced
proc = subprocess.run(
["bash", "-i", "-c", "pkgmgr --help"],
capture_output=True,
@@ -76,10 +92,6 @@ def pkgmgr_help_debug() -> None:
print(f"returncode: {proc.returncode}")
print("--- END ---\n")
# 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:
@@ -87,12 +99,8 @@ class TestIntegrationInstalPKGMGRShallow(unittest.TestCase):
End-to-end test that runs "python main.py install pkgmgr ..." inside
the test container.
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)
HOME is isolated to avoid permission problems with Nix & repositories.
"""
# 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)
@@ -103,20 +111,24 @@ class TestIntegrationInstalPKGMGRShallow(unittest.TestCase):
# 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
# Optional XDG override for a fully isolated environment
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"))
# 🔧 IMPORTANT FIX: allow Git to access /src safely
configure_git_safe_directory()
# Debug before cleanup
nix_profile_list_debug("BEFORE CLEANUP")
# Cleanup: aggressively try to drop any pkgmgr/profile entries
# Cleanup: drop any pkgmgr entries from nix profile
remove_pkgmgr_from_nix_profile()
# Debug after cleanup
nix_profile_list_debug("AFTER CLEANUP")
# Prepare argv for module execution
sys.argv = [
"python",
"install",
@@ -126,15 +138,15 @@ class TestIntegrationInstalPKGMGRShallow(unittest.TestCase):
"--no-verification",
]
# Run installation via main.py
# Execute installation via main.py
runpy.run_module("main", run_name="__main__")
# After successful installation: run `pkgmgr --help` for debug
# Debug: interactive shell test
pkgmgr_help_debug()
finally:
# Restore system state
sys.argv = original_argv
# Restore full environment
os.environ.clear()
os.environ.update(original_environ)