Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
76b7f84989 |
@@ -1,3 +1,8 @@
|
|||||||
|
## [0.4.1] - 2025-12-08
|
||||||
|
|
||||||
|
* Add branch close subcommand and integrate release close/editor flow (ChatGPT: https://chatgpt.com/share/69374f09-c760-800f-92e4-5b44a4510b62)
|
||||||
|
|
||||||
|
|
||||||
## [0.4.0] - 2025-12-08
|
## [0.4.0] - 2025-12-08
|
||||||
|
|
||||||
* Add branch closing helper and --close flag to release command, including CLI wiring and tests (see https://chatgpt.com/share/69374aec-74ec-800f-bde3-5d91dfdb9b91)
|
* Add branch closing helper and --close flag to release command, including CLI wiring and tests (see https://chatgpt.com/share/69374aec-74ec-800f-bde3-5d91dfdb9b91)
|
||||||
|
|||||||
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.4.0
|
pkgver=0.4.1
|
||||||
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.4.1-1) unstable; urgency=medium
|
||||||
|
|
||||||
|
* Add branch close subcommand and integrate release close/editor flow (ChatGPT: https://chatgpt.com/share/69374f09-c760-800f-92e4-5b44a4510b62)
|
||||||
|
|
||||||
|
-- Kevin Veen-Birkenbach <kevin@veen.world> Mon, 08 Dec 2025 23:20:28 +0100
|
||||||
|
|
||||||
package-manager (0.4.0-1) unstable; urgency=medium
|
package-manager (0.4.0-1) unstable; urgency=medium
|
||||||
|
|
||||||
* Add branch closing helper and --close flag to release command, including CLI wiring and tests (see https://chatgpt.com/share/69374aec-74ec-800f-bde3-5d91dfdb9b91)
|
* Add branch closing helper and --close flag to release command, including CLI wiring and tests (see https://chatgpt.com/share/69374aec-74ec-800f-bde3-5d91dfdb9b91)
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
rec {
|
rec {
|
||||||
pkgmgr = pyPkgs.buildPythonApplication {
|
pkgmgr = pyPkgs.buildPythonApplication {
|
||||||
pname = "package-manager";
|
pname = "package-manager";
|
||||||
version = "0.4.0";
|
version = "0.4.1";
|
||||||
|
|
||||||
# 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.4.0
|
Version: 0.4.1
|
||||||
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
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
# pkgmgr/branch_commands.py
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
|
# pkgmgr/cli_core/commands/branch.py
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from pkgmgr.cli_core.context import CLIContext
|
from pkgmgr.cli_core.context import CLIContext
|
||||||
from pkgmgr.branch_commands import open_branch
|
from pkgmgr.branch_commands import open_branch, close_branch
|
||||||
|
|
||||||
|
|
||||||
def handle_branch(args, ctx: CLIContext) -> None:
|
def handle_branch(args, ctx: CLIContext) -> None:
|
||||||
@@ -11,7 +12,8 @@ def handle_branch(args, ctx: CLIContext) -> None:
|
|||||||
Handle `pkgmgr branch` subcommands.
|
Handle `pkgmgr branch` subcommands.
|
||||||
|
|
||||||
Currently supported:
|
Currently supported:
|
||||||
- pkgmgr branch open [<name>] [--base <branch>]
|
- pkgmgr branch open [<name>] [--base <branch>]
|
||||||
|
- pkgmgr branch close [<name>] [--base <branch>]
|
||||||
"""
|
"""
|
||||||
if args.subcommand == "open":
|
if args.subcommand == "open":
|
||||||
open_branch(
|
open_branch(
|
||||||
@@ -21,5 +23,13 @@ def handle_branch(args, ctx: CLIContext) -> None:
|
|||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if args.subcommand == "close":
|
||||||
|
close_branch(
|
||||||
|
name=getattr(args, "name", None),
|
||||||
|
base_branch=getattr(args, "base", "main"),
|
||||||
|
cwd=".",
|
||||||
|
)
|
||||||
|
return
|
||||||
|
|
||||||
print(f"Unknown branch subcommand: {args.subcommand}")
|
print(f"Unknown branch subcommand: {args.subcommand}")
|
||||||
sys.exit(2)
|
sys.exit(2)
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
# pkgmgr/release.py
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
@@ -151,8 +152,14 @@ def _open_editor_for_changelog(initial_message: Optional[str] = None) -> str:
|
|||||||
tmp.write(initial_message.strip() + "\n")
|
tmp.write(initial_message.strip() + "\n")
|
||||||
tmp.flush()
|
tmp.flush()
|
||||||
|
|
||||||
# Open editor
|
# Open editor (best-effort; fall back gracefully if not available)
|
||||||
subprocess.call([editor, tmp_path])
|
try:
|
||||||
|
subprocess.call([editor, tmp_path])
|
||||||
|
except FileNotFoundError:
|
||||||
|
print(
|
||||||
|
f"[WARN] Editor {editor!r} not found; proceeding without "
|
||||||
|
"interactive changelog message."
|
||||||
|
)
|
||||||
|
|
||||||
# Read back content
|
# Read back content
|
||||||
try:
|
try:
|
||||||
@@ -651,8 +658,8 @@ def _release_impl(
|
|||||||
|
|
||||||
# 2) Update files.
|
# 2) Update files.
|
||||||
update_pyproject_version(pyproject_path, new_ver_str, preview=preview)
|
update_pyproject_version(pyproject_path, new_ver_str, preview=preview)
|
||||||
# Let update_changelog resolve or edit the message; reuse it for debian.
|
# Let update_changelog resolve or edit the message; capture it separately.
|
||||||
message = update_changelog(
|
changelog_message = update_changelog(
|
||||||
changelog_path,
|
changelog_path,
|
||||||
new_ver_str,
|
new_ver_str,
|
||||||
message=message,
|
message=message,
|
||||||
@@ -669,6 +676,12 @@ def _release_impl(
|
|||||||
spec_path = os.path.join(repo_root, "package-manager.spec")
|
spec_path = os.path.join(repo_root, "package-manager.spec")
|
||||||
update_spec_version(spec_path, new_ver_str, preview=preview)
|
update_spec_version(spec_path, new_ver_str, preview=preview)
|
||||||
|
|
||||||
|
# Determine an effective message for tag & Debian changelog.
|
||||||
|
effective_message: Optional[str] = message
|
||||||
|
if effective_message is None and isinstance(changelog_message, str):
|
||||||
|
if changelog_message.strip():
|
||||||
|
effective_message = changelog_message.strip()
|
||||||
|
|
||||||
debian_changelog_path = os.path.join(repo_root, "debian", "changelog")
|
debian_changelog_path = os.path.join(repo_root, "debian", "changelog")
|
||||||
# Use repo directory name as a simple default for package name
|
# Use repo directory name as a simple default for package name
|
||||||
package_name = os.path.basename(repo_root) or "package-manager"
|
package_name = os.path.basename(repo_root) or "package-manager"
|
||||||
@@ -676,13 +689,13 @@ def _release_impl(
|
|||||||
debian_changelog_path,
|
debian_changelog_path,
|
||||||
package_name=package_name,
|
package_name=package_name,
|
||||||
new_version=new_ver_str,
|
new_version=new_ver_str,
|
||||||
message=message,
|
message=effective_message,
|
||||||
preview=preview,
|
preview=preview,
|
||||||
)
|
)
|
||||||
|
|
||||||
# 3) Git operations: stage, commit, tag, push.
|
# 3) Git operations: stage, commit, tag, push.
|
||||||
commit_msg = f"Release version {new_ver_str}"
|
commit_msg = f"Release version {new_ver_str}"
|
||||||
tag_msg = message or commit_msg
|
tag_msg = effective_message or commit_msg
|
||||||
|
|
||||||
try:
|
try:
|
||||||
branch = get_current_branch() or "main"
|
branch = get_current_branch() or "main"
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"
|
|||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "package-manager"
|
name = "package-manager"
|
||||||
version = "0.4.0"
|
version = "0.4.1"
|
||||||
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"
|
||||||
|
|||||||
Reference in New Issue
Block a user