Kevin Veen-Birkenbach de8c3f768d feat(repository): integrate ignore filtering into selection pipeline + add unit tests
This commit introduces proper handling of the `ignore: true` flag in the
repository selection mechanism and adds comprehensive unit tests for both
`ignored.py` and `selected.py`.

- `get_selected_repos()` now filters ignored repositories in all implicit
  selection modes:
    • filter-only mode (string/category/tag)
    • `--all` mode
    • CWD-based selection

- Explicit identifiers (e.g. `pkgmgr install ignored-repo`) **bypass**
  ignore filtering, so the user can still operate directly on ignored
  repositories if they ask for them explicitly.

- Added `_maybe_filter_ignored()` helper to handle logic cleanly and allow
  future extension (e.g. integrating a CLI flag `--include-ignored`).

Under `tests/unit/pkgmgr/core/repository`:

1. **test_ignored.py**
   • Ensures `filter_ignored()` removes repos with `ignore: true`
   • Ensures empty lists are handled correctly

2. **test_selected.py**
   Comprehensive coverage of the selection logic:
   • Explicit identifiers bypass ignore filtering
   • Filter-only mode excludes ignored repos unless `include_ignored=True`
   • `--all` mode excludes ignored repos unless explicitly overridden
   • CWD-based detection filters ignored repos unless explicitly overridden

Before this change, ignored repositories still appeared in `pkgmgr list`,
`pkgmgr status`, and other commands using `get_selected_repos()`.
This was unintuitive and broke the expected semantics of the `ignore`
attribute.
The new logic ensures ignored repositories are truly invisible unless
explicitly requested.

https://chatgpt.com/share/69383b41-50a0-800f-a2b9-c680cd96d9e9
2025-12-09 16:07:39 +01:00
2025-12-08 22:40:50 +01:00
2025-12-09 15:49:01 +01:00
2025-12-07 21:52:04 +01:00
2025-12-09 15:49:01 +01:00
2025-12-09 15:49:01 +01:00
2025-03-04 13:17:09 +01:00
2025-12-09 15:49:01 +01:00
2025-12-09 15:49:01 +01:00
2025-12-09 15:49:01 +01:00
2025-07-11 07:37:21 +02:00

Package Manager🤖📦

GitHub Sponsors Patreon Buy Me a Coffee PayPal GitHub license GitHub repo size

Kevins's Package Manager is a configurable Python tool designed to manage multiple repositories via Bash. It automates common Git operations such as clone, pull, push, status, and more. Additionally, it handles the creation of executable wrappers and alias links for your repositories.

Features 🚀

  • Installation & Setup:
    Create executable wrappers with auto-detected commands (e.g. main.sh or main.py).

  • Git Operations:
    Easily perform git pull, push, status, commit, diff, add, show, and checkout with extra parameters passed through.

  • Configuration Management:
    Manage repository configurations via a default file (config/defaults.yaml) and a user-specific file (config/config.yaml). Initialize, add, delete, or ignore entries using subcommands.

  • Path & Listing:
    Display repository paths or list all configured packages with their details.

  • Custom Aliases:
    Generate and manage custom aliases for easy command invocation.

Installation ⚙️

Clone the repository and ensure your ~/.local/bin is in your system PATH:

git clone https://github.com/kevinveenbirkenbach/package-manager.git
cd package-manager

Install make and pip if not installed yet:

pacman -S make python-pip

Then, run the following command to set up the project:

make setup

The make setup command will:

  • Make main.py executable.
  • Install required packages from requirements.txt.
  • Execute python main.py install to complete the installation.

Docker Quickstart 🐳

Alternatively to installing locally, you can use Docker: build the image with

docker build --no-cache -t pkgmgr .

or alternativ pull it via

docker pull kevinveenbirkenbach/pkgmgr:latest

and then run

docker run --rm pkgmgr --help

Usage 📖

Run the script with different commands. For example:

  • Install all packages:
    pkgmgr install --all
    
  • Pull updates for a specific repository:
    pkgmgr pull pkgmgr
    
  • Commit changes with extra Git parameters:
    pkgmgr commit pkgmgr -- -m "Your commit message"
    
  • List all configured packages:
    pkgmgr config show
    
  • Manage configuration:
    pkgmgr config init
    pkgmgr config add
    pkgmgr config edit
    pkgmgr config delete <identifier>
    pkgmgr config ignore <identifier> --set true
    

License 📄

This project is licensed under the MIT License.

Author 👤

Kevin Veen-Birkenbach
https://www.veen.world


Repository: github.com/kevinveenbirkenbach/package-manager

Created with AI 🤖 - View conversation

Description
No description provided
Readme MIT 9 MiB
Languages
Python 91.4%
Shell 7.2%
Makefile 0.7%
Nix 0.4%
Dockerfile 0.2%