Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
579ded3438 | ||
|
|
eb17cddd21 |
No files matched your search
@@ -1,5 +1,12 @@
|
||||
# Changelog
|
||||
|
||||
## [2.0.5] - 2026-10-29
|
||||
|
||||
Fixed:
|
||||
|
||||
- Config: *pkgmgr config edit* opens nano instead of aborting without a TTY
|
||||
- Config: *pkgmgr config edit* exits with the editor's code when it fails
|
||||
|
||||
## [2.0.4] - 2026-10-19
|
||||
|
||||
Fixed:
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
rec {
|
||||
pkgmgr = pyPkgs.buildPythonApplication {
|
||||
pname = "package-manager";
|
||||
version = "2.0.4";
|
||||
version = "2.0.5";
|
||||
|
||||
# Use the git repo as source
|
||||
src = ./.;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Maintainer: Kevin Veen-Birkenbach <info@veen.world>
|
||||
|
||||
pkgname=package-manager
|
||||
pkgver=2.0.4
|
||||
pkgver=2.0.5
|
||||
pkgrel=1
|
||||
pkgdesc="Local-flake wrapper for Kevin's package-manager (Nix-based)."
|
||||
arch=('any')
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
package-manager (2.0.5-1) unstable; urgency=medium
|
||||
|
||||
Fixed:
|
||||
|
||||
- Config: *pkgmgr config edit* opens nano instead of aborting without a TTY
|
||||
- Config: *pkgmgr config edit* exits with the editor's code when it fails
|
||||
|
||||
-- Kevin Veen-Birkenbach <kevin@veen.world> Thu, 29 Oct 2026 13:57:31 +0100
|
||||
|
||||
package-manager (2.0.4-1) unstable; urgency=medium
|
||||
|
||||
Fixed:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
Name: package-manager
|
||||
Version: 2.0.4
|
||||
Version: 2.0.5
|
||||
Release: 1%{?dist}
|
||||
Summary: Wrapper that runs Kevin's package-manager via Nix flake
|
||||
|
||||
@@ -74,6 +74,12 @@ echo ">>> package-manager removed. Nix itself was not removed."
|
||||
/usr/lib/package-manager/
|
||||
|
||||
%changelog
|
||||
* Thu Oct 29 2026 Kevin Veen-Birkenbach <kevin@veen.world> - 2.0.5-1
|
||||
- Fixed:
|
||||
|
||||
- - Config: *pkgmgr config edit* opens nano instead of aborting without a TTY
|
||||
- - Config: *pkgmgr config edit* exits with the editor's code when it fails
|
||||
|
||||
* Mon Oct 19 2026 Kevin Veen-Birkenbach <kevin@veen.world> - 2.0.4-1
|
||||
- Fixed:
|
||||
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"
|
||||
|
||||
[project]
|
||||
name = "kpmx"
|
||||
version = "2.0.4"
|
||||
version = "2.0.5"
|
||||
description = "Kevin's package-manager tool (pkgmgr)"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.9"
|
||||
|
||||
@@ -4,6 +4,7 @@ from __future__ import annotations
|
||||
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
@@ -14,7 +15,6 @@ from pkgmgr.actions.config.add import interactive_add
|
||||
from pkgmgr.actions.config.init import config_init
|
||||
from pkgmgr.actions.config.show import show_config
|
||||
from pkgmgr.cli.context import CLIContext
|
||||
from pkgmgr.core.command.run import run_command
|
||||
from pkgmgr.core.config.save import save_user_config
|
||||
from pkgmgr.core.repository.resolve import resolve_repos
|
||||
|
||||
@@ -108,7 +108,9 @@ def handle_config(args, ctx: CLIContext) -> None:
|
||||
return
|
||||
|
||||
if args.subcommand == "edit":
|
||||
run_command(f"nano {user_config_path}")
|
||||
returncode = subprocess.call(["nano", os.path.expanduser(user_config_path)])
|
||||
if returncode != 0:
|
||||
sys.exit(returncode)
|
||||
return
|
||||
|
||||
if args.subcommand == "init":
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import types
|
||||
import unittest
|
||||
from unittest.mock import patch
|
||||
|
||||
from pkgmgr.cli.commands import config as config_cmd
|
||||
|
||||
|
||||
class ConfigEditTests(unittest.TestCase):
|
||||
def _edit(self, path: str, returncode: int):
|
||||
with patch(
|
||||
"subprocess.Popen",
|
||||
side_effect=AssertionError("the editor's output must not be captured"),
|
||||
), patch("subprocess.call", return_value=returncode) as call:
|
||||
config_cmd.handle_config(
|
||||
types.SimpleNamespace(subcommand="edit"),
|
||||
types.SimpleNamespace(user_config_path=path),
|
||||
)
|
||||
return call
|
||||
|
||||
def test_nano_inherits_the_terminal(self):
|
||||
call = self._edit("/cfg/config.yaml", 0)
|
||||
|
||||
call.assert_called_once_with(["nano", "/cfg/config.yaml"])
|
||||
|
||||
def test_a_failing_editor_exits_with_its_code(self):
|
||||
with self.assertRaises(SystemExit) as raised:
|
||||
self._edit("/cfg/config.yaml", 3)
|
||||
|
||||
self.assertEqual(raised.exception.code, 3)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user