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
This commit is contained in:
parent
de59d775f9
commit
8c1f0dd98e
1 changed files with 19 additions and 1 deletions
20
Makefile
20
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."; \
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue