Makefile
2.3 KB78 lines Opens in site
Directory
Raw
Download
# BlackCat: developer shortcuts.
#
# The canonical environment is ./.venv: exactly the one HOW_TO_USE.md
# walks a new user through. Nothing here installs anywhere else.
#
# make help list targets
# make setup venv + editable install with the TUI extra (the full path)
# make tui launch the harness
PY := .venv/bin/python
PIP := .venv/bin/pip
BIN := .venv/bin/blackcat
SYS_PY ?= python3
.DEFAULT_GOAL := help
.PHONY: help setup venv install reinstall test lint fmt run chat tui models clean
help:
@echo "BlackCat Makefile (all targets use ./.venv)"
@echo ""
@echo " make setup create .venv, then editable install with [tui,dev]"
@echo " make venv create .venv only (requires Python >= 3.11)"
@echo " make install editable install: pip install -e '.[tui,dev]'"
@echo " make reinstall force a clean editable reinstall (fixes missing commands)"
@echo " make test run the committed unittest suite"
@echo " make lint ruff check over blackcat/ and tests/"
@echo " make run one live prompt against deepseek-flash"
@echo " make chat interactive chat"
@echo " make tui the full-screen harness: blackcat --yolo tui"
@echo " make models list the models the provider offers"
@echo " make clean remove __pycache__ and build artefacts"
@echo ""
@echo "New to all this? Read HOW_TO_USE.md first."
setup: venv install
@echo ""
@echo "Done. Activate with: source .venv/bin/activate"
@echo "Then run: blackcat --yolo tui"
venv:
@test -x $(PY) || $(SYS_PY) -m venv .venv
@$(PY) -c 'import sys; sys.exit(0 if sys.version_info >= (3, 11) else 1)' \
|| { echo "Python >= 3.11 required, found $$($(PY) -V)"; exit 1; }
@$(PY) -V
install:
$(PIP) install -e '.[tui,dev]'
@test -x $(BIN) || { echo "entry points missing; run: make reinstall"; exit 1; }
reinstall:
$(PIP) uninstall -y blackcat >/dev/null 2>&1 || true
$(PIP) install -e '.[tui,dev]'
test:
$(PY) -m unittest discover -s tests
lint:
$(PY) -m ruff check blackcat/ tests/
fmt:
$(PY) -m ruff check --fix blackcat/ tests/
run:
$(BIN) --provider deepseek prompt "Reply with exactly: blackcat live test ok"
chat:
$(BIN) chat
tui:
$(BIN) --yolo tui
models:
$(BIN) --provider deepseek models
clean:
find . -name __pycache__ -type d -prune -exec rm -rf {} +
rm -rf build dist .ruff_cache