Development
Working on captain-hook itself. For using captain-hook in your project, see Installation.
Setup
git clone https://github.com/yasyf/captain-hook
cd captain-hook
uv sync --extra devNLP assets
Tests that exercise NLP signals need the spaCy English model and WordNet data:
uv run python -m spacy download en_core_web_sm
uv run python -c "import wn; wn.download('oewn:2025')"This mirrors what CI provisions — see .github/workflows/ci.yml.
Tests
uv run pytestThe example hooks in docs/examples/ carry inline tests too:
uv run capt-hook --hooks docs/examples testDocs
The docs are Great Docs (Quarto), published to GitHub Pages. The API reference is generated from docstrings at build time; the CLI reference comes from the Click app.
uv sync --group docs
uv run great-docs previewBuild and smoke-test the wheel
uv build
uv venv --seed .wheel-smoke
uv pip install --python .wheel-smoke/bin/python dist/*.whl
.wheel-smoke/bin/capt-hook --helpUsing a local checkout
From a consumer project, point uv run --project at your clone:
uv run --project path/to/captain-hook capt-hook testOr generate settings whose hook commands invoke your checkout instead of PyPI:
capt-hook generate-settings --from path/to/captain-hookReleasing
Tag a version and push — .github/workflows/release-pypi.yml builds the sdist and wheel, publishes to PyPI via trusted publishing, and cuts a GitHub release:
git tag v0.2.0
git push origin v0.2.0The package version is set from the tag at build time; the version in pyproject.toml is never bumped by hand.