Break the old god module into flat siblings for CLI parsing, run lifecycle, daemon state, shared processing helpers, benchmark tooling, and maintainer-only model sync so changes stop sharing one giant import graph. Keep aman as a thin shim over aman_cli, move sync-default-model behind the hidden aman-maint entrypoint plus Make wrappers, and update packaging metadata plus maintainer docs to reflect the new surface. Retarget the tests to the new seams with dedicated runtime, run, benchmark, maintainer, and entrypoint suites, and verify with python3 -m unittest discover -s tests -p "test_*.py", python3 -m py_compile src/*.py tests/*.py, PYTHONPATH=src python3 -m aman --help, PYTHONPATH=src python3 -m aman version, and PYTHONPATH=src python3 -m aman_maint --help.
102 lines
2.9 KiB
Makefile
102 lines
2.9 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 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'
|
|
|
|
check:
|
|
$(PYTHON) -m py_compile src/*.py
|
|
$(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
|
|
$(PYTHON) -m py_compile src/*.py tests/*.py
|
|
$(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
|