Document dependencies and check them at init time (#18)#43
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #18.
issue-flow's scaffolded slash commands shell out to
gitandgh, 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.src/issue_flow/dependencies.pydeclaresREQUIRED_DEPENDENCIES(git,gh) with per-OS install hints and a docs link each.check_dependencies()usesshutil.whichonly.prompt_or_skip()prints a rich-formatted "missing deps" report and either:--skip-dep-checkis set, ortyper.confirmand returns the user's decision.run_init/run_updatenow run the gate before any scaffolding; a decline raisestyper.Exit(1). Both gained askip_dep_checkkwarg.issue-flow initandissue-flow updateboth expose--skip-dep-checkfor automation.git,gh(with an OS install table plus agh auth loginreminder), anduv, plus notes on the new check. Option tables and the Usage snippet updated to list the flag.uvis 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/conftest.pyautouse fixture stubscheck_dependenciesto[]by default so unrelated tests stay deterministic on machines withoutgit/gh. Newtests/test_dependencies.py(11 cases) plus four newtests/test_init.pycases for all-present,--skip-dep-check, non-TTY bypass, and the decline path (typer.Exit(1), no scaffold written).Test plan
uv run pytest— 64 passeduv run ruff check src/ tests/— cleanuv run issue-flow init --helpshows the new--skip-dep-checkflagshutil.which('gh')patched to returnNone,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