-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathMakefile
More file actions
55 lines (41 loc) · 1.73 KB
/
Makefile
File metadata and controls
55 lines (41 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
VENV_BIN = python3 -m venv
VENV_DIR ?= .venv
VENV_ACTIVATE = $(VENV_DIR)/bin/activate
VENV_RUN = . $(VENV_ACTIVATE)
usage: ## Shows usage for this Makefile
@cat Makefile | grep -E '^[a-zA-Z_-]+:.*?## .*$$' | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-15s\033[0m %s\n", $$1, $$2}'
venv: $(VENV_ACTIVATE)
$(VENV_ACTIVATE): pyproject.toml
test -d .venv || $(VENV_BIN) .venv
$(VENV_RUN); pip install --upgrade pip setuptools plux
$(VENV_RUN); pip install -e .[dev]
touch $(VENV_DIR)/bin/activate
clean:
rm -rf .venv/
rm -rf build/
rm -rf .eggs/
rm -rf *.egg-info/
install: venv ## Install dependencies
$(VENV_RUN); python -m plux entrypoints
dist: venv ## Create distribution
$(VENV_RUN); python -m build
publish: clean-dist venv dist ## Publish extension to pypi
$(VENV_RUN); pip install --upgrade twine; twine upload dist/*
entrypoints: venv # Generate plugin entrypoints for Python package
$(VENV_RUN); python -m plux entrypoints
format: ## Run ruff to format the whole codebase
$(VENV_RUN); python -m ruff format .; python -m ruff check --output-format=full --fix .
lint: ## Run ruff to lint the codebase
$(VENV_RUN); python -m ruff check --output-format=full .
test: ## Run pytest tests (requires LocalStack running)
$(VENV_RUN); python -m pytest tests/ -v
sample-app: ## Deploy sample app with Lambda + Vault
@echo "Setting up Vault secrets..."
sample-app-extension/bin/setup-vault.sh
@echo "Deploying Lambda function with Vault Lambda Extension..."
sample-app-extension/bin/deploy-lambda.sh
@echo "Testing Lambda invocation..."
sample-app-extension/bin/test-lambda.sh
clean-dist: clean
rm -rf dist/
.PHONY: clean clean-dist dist install publish usage venv format lint test sample-app