Skip to content

fix: replace Python shebang with bash wrapper for venv-safe invocation - #9

Open
griffincapmisc wants to merge 1 commit into
griffinwork40:mainfrom
griffincapmisc:fix/bash-wrapper-venv-resolution
Open

fix: replace Python shebang with bash wrapper for venv-safe invocation#9
griffincapmisc wants to merge 1 commit into
griffinwork40:mainfrom
griffincapmisc:fix/bash-wrapper-venv-resolution

Conversation

@griffincapmisc

Copy link
Copy Markdown

The bare #!/usr/bin/env python3 shebang breaks when the system Python upgrades (e.g. Homebrew 3.9 → 3.13) and pip packages like typer/httpx are stranded in the old site-packages — every invocation hits ModuleNotFoundError: No module named 'typer'.

Fix: Replace the Python entrypoint with a bash wrapper (matching ga-cli's pattern) that:

  1. Resolves symlinks before computing DIR (so AFK plugin symlinks work)
  2. Finds a .venv at repo-root or skill-root before falling back to system Python
  3. Uses python -m substack_cli via a new __main__.py

Install after cloning:

cd substack-cli && python3 -m venv .venv && .venv/bin/pip install typer httpx

The bare #!/usr/bin/env python3 shebang breaks when the system Python
upgrades (e.g. Homebrew 3.9 → 3.13) and pip packages like typer/httpx
are stranded in the old site-packages.

Replace with a bash wrapper (matching ga-cli's pattern) that:
- resolves symlinks before computing DIR
- finds a .venv at repo-root or skill-root
- falls back to system Python only if no venv exists
- adds __main__.py so the package works with python -m substack_cli
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant