From 8c1f0dd98e1dd015f346eeb9f97475bb801c1c5f Mon Sep 17 00:00:00 2001 From: Taddeus Date: Mon, 3 Nov 2025 14:37:16 +0200 Subject: [PATCH] Adds Makefile targets for dependency management, linting, and testing Introduces install and setup targets to streamline project dependency installation using Poetry. Adds lint target to run pre-commit checks automatically. Adds test-unit target for running the unit test suite with pytest. These enhancements improve developer experience by standardizing common tasks within the Makefile. Relates to MLO-469 --- Makefile | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index a9239dc2..fdbf9a5b 100644 --- a/Makefile +++ b/Makefile @@ -18,9 +18,16 @@ BUILD_IMAGE_TAG ?= $(CHART_VERSION) IMAGE_TAG ?= $(BUILD_IMAGE_TAG) HOOKS_BUILD_IMAGE := $(HOOKS_IMAGE_REPO):$(BUILD_IMAGE_TAG) HOOKS_PUBLISH_IMAGE := $(HOOKS_IMAGE_REPO):$(IMAGE_TAG) +POETRY ?= poetry +POETRY_RUN := $(POETRY) run +PYTEST_TARGET ?= .apolo/tests define HELP_MESSAGE Available targets: + install - Install project dependencies (including dev extras) + setup - Alias for install (compatibility) + lint - Run pre-commit checks across the repository + test-unit - Execute unit test suite with pytest helm-package - Package the LightRAG Helm chart (version: $(CHART_VERSION)) helm-push - Package and push the chart to $(HELM_REGISTRY) clean - Remove packaged charts from $(CHART_PACKAGE_DIR) @@ -31,13 +38,24 @@ Set VERSION=1.2.3 to override the git-derived chart version. endef export HELP_MESSAGE -.PHONY: all help helm-package helm-push clean test hooks-build hooks-publish build-hook-image push-hook-image +.PHONY: all help install setup lint test-unit helm-package helm-push clean test hooks-build hooks-publish build-hook-image push-hook-image all: help help: @printf "%s\n" "$$HELP_MESSAGE" +install: + $(POETRY) install --with dev + +setup: install + +lint: + $(POETRY_RUN) pre-commit run --all-files --show-diff-on-failure + +test-unit: + $(POETRY_RUN) pytest $(PYTEST_TARGET) + helm-package: @if [ -z "$(CHART_VERSION)" ]; then \ echo "Error: unable to determine chart version."; \