From b8ebb67a42fca3f0123a8a30f74986467f1a710f Mon Sep 17 00:00:00 2001 From: kicka5h Date: Tue, 10 Mar 2026 14:15:34 -0700 Subject: [PATCH 1/2] bug fix for snack list --- .github/workflows/publish.yml | 3 ++- snacks/main.py | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 5642566..ab32318 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -51,6 +51,8 @@ jobs: needs: build runs-on: ubuntu-latest environment: pypi + permissions: + id-token: write # required for OIDC trusted publishing steps: - name: Download build artifacts @@ -62,7 +64,6 @@ jobs: - name: Publish to PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: - password: ${{ secrets.PYPI_TOKEN }} verbose: true # ── 4. Create GitHub Release and attach artifacts ─────────────────────────── diff --git a/snacks/main.py b/snacks/main.py index 8132a78..9392223 100644 --- a/snacks/main.py +++ b/snacks/main.py @@ -22,7 +22,7 @@ def _version_callback(value: bool) -> None: if value: version = importlib.metadata.version("python-snacks") - typer.echo(f"snack-stash v{version}") + typer.echo(f"python-snacks v{version}") raise typer.Exit() @@ -68,7 +68,7 @@ def list_snacks( snippets = sorted( p.relative_to(stash).as_posix() for p in stash.rglob("*.py") - if not p.name.startswith("_") + if not any(part.startswith(("_", ".")) for part in p.relative_to(stash).parts) ) if category: snippets = [s for s in snippets if s.startswith(f"{category}/")] @@ -84,7 +84,8 @@ def search( matches = sorted( p.relative_to(stash).as_posix() for p in stash.rglob("*.py") - if keyword.lower() in p.name.lower() and not p.name.startswith("_") + if keyword.lower() in p.name.lower() + and not any(part.startswith(("_", ".")) for part in p.relative_to(stash).parts) ) typer.echo("\n".join(matches) if matches else f"No snippets matching '{keyword}'.") From 671926a47887127ee4cfd590b25fede8e0d5b771 Mon Sep 17 00:00:00 2001 From: kicka5h Date: Tue, 10 Mar 2026 14:17:48 -0700 Subject: [PATCH 2/2] update wiki & templates --- .github/ISSUE_TEMPLATE/bug_report.md | 2 +- README.md | 14 ++++++++++---- wiki/Home.md | 6 +++--- wiki/Installation.md | 10 +++++----- 4 files changed, 19 insertions(+), 13 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 961e38f..128a994 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -26,5 +26,5 @@ labels: bug - OS: - Python version (`python --version`): -- snack-stash version (`pip show snack-stash | grep Version`): +- python-snacks version (`pip show python-snacks | grep Version`): - Install method: diff --git a/README.md b/README.md index 90a486d..0bc2bc9 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ -# Snack Stash +# python-snacks A personal CLI tool for managing a local stash of reusable Python code snippets. Browse, copy, and curate snippets across projects with a single command. ```bash -pipx install snack-stash +pipx install python-snacks snack stash create default ~/snack-stash snack unpack auth/google_oauth.py ``` @@ -14,16 +14,22 @@ snack unpack auth/google_oauth.py **Recommended (pipx):** ```bash -pipx install snack-stash +pipx install python-snacks ``` **Alternative (pip):** ```bash -pip install snack-stash +pip install python-snacks ``` Requires Python 3.10+. +**Updating:** +```bash +pipx upgrade python-snacks # if installed with pipx +pip install --upgrade python-snacks # if installed with pip +``` + --- ## Configuration diff --git a/wiki/Home.md b/wiki/Home.md index 1503bbc..4195df1 100644 --- a/wiki/Home.md +++ b/wiki/Home.md @@ -1,4 +1,4 @@ -# Snack Stash +# python-snacks A personal CLI tool for managing a local stash of reusable Python code snippets. Copy snippets in and out of projects with a single command, and manage multiple named stashes. @@ -6,7 +6,7 @@ A personal CLI tool for managing a local stash of reusable Python code snippets. ```bash # Install -pipx install snack-stash +pipx install python-snacks # Create your first stash snack stash create default ~/snack-stash @@ -35,5 +35,5 @@ snack pack auth/google_oauth.py ## Links -- [PyPI — snack-stash](https://pypi.org/project/snack-stash/) +- [PyPI — python-snacks](https://pypi.org/project/python-snacks/) - [GitHub Repository](https://github.com/kickash/python-snacks) diff --git a/wiki/Installation.md b/wiki/Installation.md index e032954..f07f075 100644 --- a/wiki/Installation.md +++ b/wiki/Installation.md @@ -9,16 +9,16 @@ [pipx](https://pipx.pypa.io) installs CLI tools in isolated environments so they don't conflict with your project dependencies. ```bash -pipx install snack-stash +pipx install python-snacks ``` ## Alternative: pip ```bash -pip install snack-stash +pip install python-snacks ``` -If you want it available globally, use `pip install --user snack-stash` or install inside a virtual environment you always activate. +If you want it available globally, use `pip install --user python-snacks` or install inside a virtual environment you always activate. ## Verify @@ -44,9 +44,9 @@ Commands: ## Upgrading ```bash -pipx upgrade snack-stash +pipx upgrade python-snacks # or -pip install --upgrade snack-stash +pip install --upgrade python-snacks ``` New versions are published to PyPI automatically when a `v*` tag is pushed to the repository.