Skip to content

Document dependencies and check them at init time (#18)#43

Merged
jepegit merged 1 commit into
mainfrom
18-better-documentation-on-dependencies
Apr 19, 2026
Merged

Document dependencies and check them at init time (#18)#43
jepegit merged 1 commit into
mainfrom
18-better-documentation-on-dependencies

Conversation

@jepegit
Copy link
Copy Markdown
Owner

@jepegit jepegit commented Apr 19, 2026

Summary

Closes #18.

issue-flow's scaffolded slash commands shell out to git and gh, but that was only discoverable by running a command and hitting a confusing failure. This PR makes the dependency list explicit both in docs and at install time.

  • New src/issue_flow/dependencies.py declares REQUIRED_DEPENDENCIES (git, gh) with per-OS install hints and a docs link each. check_dependencies() uses shutil.which only. prompt_or_skip() prints a rich-formatted "missing deps" report and either:
    • bypasses the prompt when --skip-dep-check is set, or
    • bypasses the prompt when stdin is non-interactive (CI), or
    • calls typer.confirm and returns the user's decision.
  • run_init / run_update now run the gate before any scaffolding; a decline raises typer.Exit(1). Both gained a skip_dep_check kwarg.
  • CLIissue-flow init and issue-flow update both expose --skip-dep-check for automation.
  • README — new Prerequisites section above Installation covering git, gh (with an OS install table plus a gh auth login reminder), and uv, plus notes on the new check. Option tables and the Usage snippet updated to list the flag. uv is intentionally only in the README — it is an install-time prerequisite, not something the scaffolded workflow shells out to at runtime.
  • HISTORY.md — new [Unreleased] bullet.
  • Tests — new tests/conftest.py autouse fixture stubs check_dependencies to [] by default so unrelated tests stay deterministic on machines without git/gh. New tests/test_dependencies.py (11 cases) plus four new tests/test_init.py cases for all-present, --skip-dep-check, non-TTY bypass, and the decline path (typer.Exit(1), no scaffold written).

Test plan

  • uv run pytest64 passed
  • uv run ruff check src/ tests/ — clean
  • uv run issue-flow init --help shows the new --skip-dep-check flag
  • Manual: with shutil.which('gh') patched to return None, run_init(..., skip_dep_check=True) scaffolds successfully (20 files). Without the flag the full install-hint report is printed and the prompt is reached.

Made with Cursor

issue-flow's scaffolded slash commands shell out to git and gh, but that
was only discoverable by running a command and hitting an error. This
change surfaces the dependency list up front.

- New src/issue_flow/dependencies.py: declares REQUIRED_DEPENDENCIES
  (git, gh) with per-OS install hints and a docs URL, exposes a pure
  shutil.which-based check_dependencies(), and a prompt_or_skip() that
  prints a rich-formatted missing-deps report and either bypasses
  (explicit flag or non-TTY stdin) or calls typer.confirm.
- run_init and run_update gain a skip_dep_check kwarg and run the gate
  before any scaffolding; a decline raises typer.Exit(1).
- CLI: init and update both grow a --skip-dep-check flag for automation.
- README: new Prerequisites section above Installation covering git,
  gh (with an OS install table and a gh auth login reminder), and uv,
  plus notes on the new check. Option tables and the Usage snippet
  updated to list the flag.
- HISTORY.md: new [Unreleased] bullet.
- tests/conftest.py: autouse fixture stubs check_dependencies to [] by
  default so the rest of the suite stays deterministic across dev/CI.
- New tests/test_dependencies.py (11 cases) plus four new init cases
  covering all-present, --skip-dep-check, non-TTY bypass, and the
  decline -> typer.Exit(1) with no scaffold written.

uv run pytest: 64 passed. uv run ruff check src/ tests/: clean.

Closes #18

Made-with: Cursor
@jepegit jepegit linked an issue Apr 19, 2026 that may be closed by this pull request
@jepegit jepegit merged commit 434c3f6 into main Apr 19, 2026
1 check passed
@jepegit jepegit deleted the 18-better-documentation-on-dependencies branch April 19, 2026 18:41
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.

better documentation on dependencies

1 participant