Stop letting the explicit compile step overstate its coverage. The old py_compile globs only touched top-level modules, so syntax errors in nested packages could slip past make check and release-check.\n\nAdd a shared compile-check recipe in Makefile that runs python -m compileall -q src tests, and have both check and release-check use it so the local verification paths stay aligned. Update the GitHub Actions compile step and the matching runtime validation evidence doc to describe the same recursive compile contract.\n\nValidate with python3 -m compileall -q src tests, make check, and make release-check.
105 lines
3 KiB
Makefile
105 lines
3 KiB
Makefile
PYTHON ?= python3
|
|
CONFIG := $(HOME)/.config/aman/config.json
|
|
DIST_DIR := $(CURDIR)/dist
|
|
BUILD_DIR := $(CURDIR)/build
|
|
|
|
RUN_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
|
|
RUN_CONFIG := $(if $(RUN_ARGS),$(abspath $(firstword $(RUN_ARGS))),$(CONFIG))
|
|
|
|
.PHONY: run doctor self-check runtime-check eval-models build-heuristic-dataset sync-default-model check-default-model sync test compile-check check build package package-deb package-arch package-portable release-check release-prep install-local install-service install clean-dist clean-build clean
|
|
EVAL_DATASET ?= $(CURDIR)/benchmarks/cleanup_dataset.jsonl
|
|
EVAL_MATRIX ?= $(CURDIR)/benchmarks/model_matrix.small_first.json
|
|
EVAL_OUTPUT ?= $(CURDIR)/benchmarks/results/latest.json
|
|
EVAL_HEURISTIC_RAW ?= $(CURDIR)/benchmarks/heuristics_dataset.raw.jsonl
|
|
EVAL_HEURISTIC_DATASET ?= $(CURDIR)/benchmarks/heuristics_dataset.jsonl
|
|
EVAL_HEURISTIC_WEIGHT ?= 0.25
|
|
MODEL_ARTIFACTS ?= $(CURDIR)/benchmarks/model_artifacts.json
|
|
CONSTANTS_FILE ?= $(CURDIR)/src/constants.py
|
|
|
|
ifneq ($(filter run,$(firstword $(MAKECMDGOALS))),)
|
|
.PHONY: $(RUN_ARGS)
|
|
$(RUN_ARGS):
|
|
@:
|
|
endif
|
|
|
|
run:
|
|
uv run aman run --config $(RUN_CONFIG)
|
|
|
|
doctor:
|
|
uv run aman doctor --config $(CONFIG)
|
|
|
|
self-check:
|
|
uv run aman self-check --config $(CONFIG)
|
|
|
|
runtime-check:
|
|
$(PYTHON) -m unittest tests.test_diagnostics tests.test_aman_cli tests.test_aman_run tests.test_aman_runtime tests.test_aiprocess
|
|
|
|
build-heuristic-dataset:
|
|
uv run aman build-heuristic-dataset --input $(EVAL_HEURISTIC_RAW) --output $(EVAL_HEURISTIC_DATASET)
|
|
|
|
eval-models: build-heuristic-dataset
|
|
uv run aman eval-models --dataset $(EVAL_DATASET) --matrix $(EVAL_MATRIX) --heuristic-dataset $(EVAL_HEURISTIC_DATASET) --heuristic-weight $(EVAL_HEURISTIC_WEIGHT) --output $(EVAL_OUTPUT)
|
|
|
|
sync-default-model:
|
|
uv run aman-maint sync-default-model --report $(EVAL_OUTPUT) --artifacts $(MODEL_ARTIFACTS) --constants $(CONSTANTS_FILE)
|
|
|
|
check-default-model:
|
|
uv run aman-maint sync-default-model --check --report $(EVAL_OUTPUT) --artifacts $(MODEL_ARTIFACTS) --constants $(CONSTANTS_FILE)
|
|
|
|
sync:
|
|
uv sync
|
|
|
|
test:
|
|
$(PYTHON) -m unittest discover -s tests -p 'test_*.py'
|
|
|
|
compile-check:
|
|
$(PYTHON) -m compileall -q src tests
|
|
|
|
check:
|
|
$(MAKE) compile-check
|
|
$(MAKE) test
|
|
|
|
build:
|
|
$(PYTHON) -m build --no-isolation
|
|
|
|
package: package-deb package-arch package-portable
|
|
|
|
package-deb:
|
|
./scripts/package_deb.sh
|
|
|
|
package-arch:
|
|
./scripts/package_arch.sh
|
|
|
|
package-portable:
|
|
./scripts/package_portable.sh
|
|
|
|
release-check:
|
|
$(MAKE) check-default-model
|
|
$(MAKE) compile-check
|
|
$(MAKE) runtime-check
|
|
$(MAKE) test
|
|
$(MAKE) build
|
|
|
|
release-prep:
|
|
$(MAKE) release-check
|
|
$(MAKE) package
|
|
./scripts/prepare_release.sh
|
|
|
|
install-local:
|
|
$(PYTHON) -m pip install --user .
|
|
|
|
install-service:
|
|
mkdir -p $(HOME)/.config/systemd/user
|
|
cp systemd/aman.service $(HOME)/.config/systemd/user/aman.service
|
|
systemctl --user daemon-reload
|
|
systemctl --user enable --now aman
|
|
|
|
install: install-local install-service
|
|
|
|
clean-dist:
|
|
rm -rf $(DIST_DIR)
|
|
|
|
clean-build:
|
|
rm -rf $(BUILD_DIR)
|
|
|
|
clean: clean-build
|