Release version 0.7.10
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
## [0.7.10] - 2025-12-09
|
||||||
|
|
||||||
|
* Fixed test_install_pkgmgr_shallow.py
|
||||||
|
|
||||||
|
|
||||||
## [0.7.9] - 2025-12-09
|
## [0.7.9] - 2025-12-09
|
||||||
|
|
||||||
* 'main' and 'master' are now both accepted as branches for branch close merge
|
* 'main' and 'master' are now both accepted as branches for branch close merge
|
||||||
|
|||||||
2
PKGBUILD
2
PKGBUILD
@@ -1,7 +1,7 @@
|
|||||||
# Maintainer: Kevin Veen-Birkenbach <info@veen.world>
|
# Maintainer: Kevin Veen-Birkenbach <info@veen.world>
|
||||||
|
|
||||||
pkgname=package-manager
|
pkgname=package-manager
|
||||||
pkgver=0.7.9
|
pkgver=0.7.10
|
||||||
pkgrel=1
|
pkgrel=1
|
||||||
pkgdesc="Local-flake wrapper for Kevin's package-manager (Nix-based)."
|
pkgdesc="Local-flake wrapper for Kevin's package-manager (Nix-based)."
|
||||||
arch=('any')
|
arch=('any')
|
||||||
|
|||||||
6
debian/changelog
vendored
6
debian/changelog
vendored
@@ -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
|
package-manager (0.7.9-1) unstable; urgency=medium
|
||||||
|
|
||||||
* 'main' and 'master' are now both accepted as branches for branch close merge
|
* 'main' and 'master' are now both accepted as branches for branch close merge
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
rec {
|
rec {
|
||||||
pkgmgr = pyPkgs.buildPythonApplication {
|
pkgmgr = pyPkgs.buildPythonApplication {
|
||||||
pname = "package-manager";
|
pname = "package-manager";
|
||||||
version = "0.7.9";
|
version = "0.7.10";
|
||||||
|
|
||||||
# Use the git repo as source
|
# Use the git repo as source
|
||||||
src = ./.;
|
src = ./.;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
Name: package-manager
|
Name: package-manager
|
||||||
Version: 0.7.9
|
Version: 0.7.10
|
||||||
Release: 1%{?dist}
|
Release: 1%{?dist}
|
||||||
Summary: Wrapper that runs Kevin's package-manager via Nix flake
|
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/
|
/usr/lib/package-manager/
|
||||||
|
|
||||||
%changelog
|
%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
|
* 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
|
- 'main' and 'master' are now both accepted as branches for branch close merge
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"
|
|||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "package-manager"
|
name = "package-manager"
|
||||||
version = "0.7.9"
|
version = "0.7.10"
|
||||||
description = "Kevin's package-manager tool (pkgmgr)"
|
description = "Kevin's package-manager tool (pkgmgr)"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
requires-python = ">=3.11"
|
requires-python = ">=3.11"
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ dnf -y install \
|
|||||||
bash \
|
bash \
|
||||||
curl-minimal \
|
curl-minimal \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
|
sudo \
|
||||||
xz
|
xz
|
||||||
|
|
||||||
dnf clean all
|
dnf clean all
|
||||||
|
|||||||
@@ -35,8 +35,8 @@ def remove_pkgmgr_from_nix_profile() -> None:
|
|||||||
prints a descriptive format without an index column inside the container.
|
prints a descriptive format without an index column inside the container.
|
||||||
|
|
||||||
Instead, we directly try to remove possible names:
|
Instead, we directly try to remove possible names:
|
||||||
- 'pkgmgr' (the actual name shown in `nix profile list`)
|
- 'pkgmgr'
|
||||||
- 'package-manager' (the name mentioned in Nix's own error hints)
|
- 'package-manager'
|
||||||
"""
|
"""
|
||||||
for spec in ("pkgmgr", "package-manager"):
|
for spec in ("pkgmgr", "package-manager"):
|
||||||
subprocess.run(
|
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:
|
def pkgmgr_help_debug() -> None:
|
||||||
"""
|
"""
|
||||||
Run `pkgmgr --help` after installation *inside an interactive bash shell*,
|
Run `pkgmgr --help` after installation *inside an interactive bash shell*,
|
||||||
print its output and return code, but never fail the test.
|
print its output and return code, but never fail the test.
|
||||||
|
|
||||||
Reason:
|
This ensures the installer’s shell RC changes are actually loaded.
|
||||||
- The installer adds venv/alias setup into shell rc files (~/.bashrc, ~/.zshrc)
|
|
||||||
- Those changes are only applied in a new interactive shell session.
|
|
||||||
"""
|
"""
|
||||||
print("\n--- PKGMGR HELP (after installation, via bash -i) ---")
|
print("\n--- PKGMGR HELP (after installation, via bash -i) ---")
|
||||||
|
|
||||||
# Simulate a fresh interactive bash, so ~/.bashrc gets sourced
|
|
||||||
proc = subprocess.run(
|
proc = subprocess.run(
|
||||||
["bash", "-i", "-c", "pkgmgr --help"],
|
["bash", "-i", "-c", "pkgmgr --help"],
|
||||||
capture_output=True,
|
capture_output=True,
|
||||||
@@ -76,10 +92,6 @@ def pkgmgr_help_debug() -> None:
|
|||||||
print(f"returncode: {proc.returncode}")
|
print(f"returncode: {proc.returncode}")
|
||||||
print("--- END ---\n")
|
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):
|
class TestIntegrationInstalPKGMGRShallow(unittest.TestCase):
|
||||||
def test_install_pkgmgr_self_install(self) -> None:
|
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
|
End-to-end test that runs "python main.py install pkgmgr ..." inside
|
||||||
the test container.
|
the test container.
|
||||||
|
|
||||||
We isolate HOME into /tmp/pkgmgr-self-install so that:
|
HOME is isolated to avoid permission problems with Nix & repositories.
|
||||||
- ~/.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"
|
temp_home = "/tmp/pkgmgr-self-install"
|
||||||
os.makedirs(temp_home, exist_ok=True)
|
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
|
# Isolate HOME so that ~ expands to /tmp/pkgmgr-self-install
|
||||||
os.environ["HOME"] = temp_home
|
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_CONFIG_HOME", os.path.join(temp_home, ".config"))
|
||||||
os.environ.setdefault("XDG_CACHE_HOME", os.path.join(temp_home, ".cache"))
|
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"))
|
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
|
# Debug before cleanup
|
||||||
nix_profile_list_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()
|
remove_pkgmgr_from_nix_profile()
|
||||||
|
|
||||||
# Debug after cleanup
|
# Debug after cleanup
|
||||||
nix_profile_list_debug("AFTER CLEANUP")
|
nix_profile_list_debug("AFTER CLEANUP")
|
||||||
|
|
||||||
|
# Prepare argv for module execution
|
||||||
sys.argv = [
|
sys.argv = [
|
||||||
"python",
|
"python",
|
||||||
"install",
|
"install",
|
||||||
@@ -126,15 +138,15 @@ class TestIntegrationInstalPKGMGRShallow(unittest.TestCase):
|
|||||||
"--no-verification",
|
"--no-verification",
|
||||||
]
|
]
|
||||||
|
|
||||||
# Run installation via main.py
|
# Execute installation via main.py
|
||||||
runpy.run_module("main", run_name="__main__")
|
runpy.run_module("main", run_name="__main__")
|
||||||
|
|
||||||
# After successful installation: run `pkgmgr --help` for debug
|
# Debug: interactive shell test
|
||||||
pkgmgr_help_debug()
|
pkgmgr_help_debug()
|
||||||
|
|
||||||
finally:
|
finally:
|
||||||
|
# Restore system state
|
||||||
sys.argv = original_argv
|
sys.argv = original_argv
|
||||||
# Restore full environment
|
|
||||||
os.environ.clear()
|
os.environ.clear()
|
||||||
os.environ.update(original_environ)
|
os.environ.update(original_environ)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user