-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
82 lines (63 loc) · 2.27 KB
/
Makefile
File metadata and controls
82 lines (63 loc) · 2.27 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/usr/bin/make -f
# -*- makefile -*-
SHELL := /bin/bash
.SHELLFLAGS := -eu -o pipefail -c
.DEFAULT_GOAL := help
.LOGGING := 0
.ONESHELL: ; # Recipes execute in same shell
.NOTPARALLEL: ; # Wait for this target to finish
.SILENT: ; # No need for @
.EXPORT_ALL_VARIABLES: ; # Export variables to child processes.
.DELETE_ON_ERROR: ; # Delete target if recipe fails.
# Modify the block character to be `-\t` instead of `\t`
ifeq ($(origin .RECIPEPREFIX), undefined)
$(error This version of Make does not support .RECIPEPREFIX.)
endif
.RECIPEPREFIX = -
PROJECT_DIR := $(shell git rev-parse --show-toplevel)
SRC_DIR := $(PROJECT_DIR)/src
BUILD_DIR := $(PROJECT_DIR)/dist
default: $(.DEFAULT_GOAL)
all: help
.PHONY: help
help: ## List commands <default>
- echo -e "USAGE: make \033[36m[COMMAND]\033[0m\n"
- echo "Available commands:"
- awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\t\033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
.PHONY: build
build: ## Build the application
- pip install wheel
- pip install --upgrade pip wheel
- pip install --editable ".[developer]"
- hatch build --clean --target wheel
.PHONY: run
run: ## Run the application
- source-agent
.PHONY: lint
lint: ## Lint the code
- black $(SRC_DIR)
- ruff check $(SRC_DIR) --fix
.PHONY: bandit
bandit: ## Run bandit
- bandit --config $(PROJECT_DIR)/pyproject.toml --recursive . --verbose
# - bandit --config $(PROJECT_DIR)/pyproject.toml --recursive . --verbose --format html --output bandit_report.html
.PHONY: test
test: ## Run the tests
- pytest -s
- pytest --cov=src
.PHONY: test-tools
test-tools: ## Run tool CRUDE tests
# CREATE
- source-agent --prompt "create a directory called 'test'"
# READ
- source-agent --prompt "summarize the project readme"
- source-agent --prompt "list all files in the project root directory"
- source-agent --prompt "find all the files that import 'registry'"
# UPDATE
- source-agent --prompt "write the words 'test' to a file named 'test/testing.txt'"
# DELETE
- source-agent --prompt "delete the file 'test/testing.txt'"
- source-agent --prompt "delete the directory 'test'"
# EXECUTE
- source-agent --prompt "calculate (9+1)*6/2"
- source-agent --prompt "search the web for how to create a virtual environment with 'uv'"