aman/Makefile
Thales Maciel c6fc61c885
Some checks failed
ci / Unit Matrix (3.10) (push) Has been cancelled
ci / Unit Matrix (3.11) (push) Has been cancelled
ci / Unit Matrix (3.12) (push) Has been cancelled
ci / Portable Ubuntu Smoke (push) Has been cancelled
ci / Package Artifacts (push) Has been cancelled
Normalize native dependency ownership and split config UI
Make distro packages the single source of truth for GTK/X11 Python bindings instead of advertising them as wheel-managed runtime dependencies. Update the uv, CI, and packaging workflows to use system site packages, regenerate uv.lock, and keep portable and Arch metadata aligned with that contract.

Pull runtime policy, audio probing, and page builders out of config_ui.py so the settings window becomes a coordinator instead of a single large mixed-concern module. Rename the config serialization and logging helpers, and stop startup logging from exposing raw vocabulary entries or custom model paths.

Remove stale helper aliases and add regression coverage for safe startup logging, packaging metadata and module drift, portable requirements, and the extracted audio helper behavior.

Validated with uv lock, python3 -m compileall -q src tests, python3 -m unittest discover -s tests -p 'test_*.py', make build, and make package-arch.
2026-03-15 11:27:54 -03:00

109 lines
3.2 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:
@if [ ! -f .venv/pyvenv.cfg ] || ! grep -q '^include-system-site-packages = true' .venv/pyvenv.cfg; then \
rm -rf .venv; \
$(PYTHON) -m venv --system-site-packages .venv; \
fi
UV_PROJECT_ENVIRONMENT=$(CURDIR)/.venv 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