Skip to content

Commit 13a46d2

Browse files
committed
modify makefile
1 parent 8b2560a commit 13a46d2

File tree

1 file changed

+43
-6
lines changed

1 file changed

+43
-6
lines changed

Makefile

Lines changed: 43 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,56 @@
1+
# Variables for reusable values
2+
PACKAGE := eventsourcingdb
3+
TEST_DIR := tests
4+
PYTHON_DIRS := $(PACKAGE) $(TEST_DIR)
5+
6+
# Default target and help
7+
.DEFAULT_GOAL := help
8+
help:
9+
@echo "Available commands:"
10+
@echo " qa : Run analysis and tests"
11+
@echo " analyze : Run code analysis with ruff"
12+
@echo " format : Format code"
13+
@echo " test : Run tests"
14+
@echo " coverage : Check test coverage"
15+
@echo " lock : Lock dependencies with uv"
16+
@echo " clean : Remove temporary files"
17+
@echo " build : Run QA and prepare build"
18+
119
qa: analyze test
220

321
analyze:
4-
@poetry run pylint eventsourcingdb tests
22+
@echo "Running code analysis..."
23+
@uv run ruff $(PYTHON_DIRS)
524

625
format:
7-
@poetry run autopep8 --in-place --aggressive --max-line-length=100 --recursive eventsourcingdb tests
8-
26+
@echo "Formatting code..."
27+
@uv run ruff format --in-place --aggressive --max-line-length=100 --recursive $(PYTHON_DIRS)
28+
929
lock:
10-
@poetry lock
30+
@echo "Updating dependency lock..."
31+
@uv run uv lock
1132

1233
test:
13-
@poetry run pytest --maxfail=1
34+
@echo "Running tests..."
35+
@uv run pytest --maxfail=1
36+
37+
coverage:
38+
@echo "Checking test coverage..."
39+
@uv run pytest --cov=$(PACKAGE) --cov-report=term-missing $(TEST_DIR)
1440

1541
clean:
42+
@echo "Cleaning up..."
43+
@find . -type d -name __pycache__ -exec rm -rf {} +
44+
@find . -type f -name "*.pyc" -delete
45+
@find . -type f -name "*.pyo" -delete
46+
@find . -type f -name "*.pyd" -delete
47+
@find . -type f -name ".coverage" -delete
48+
@find . -type d -name "*.egg-info" -exec rm -rf {} +
49+
@find . -type d -name "*.egg" -exec rm -rf {} +
50+
@find . -type d -name ".pytest_cache" -exec rm -rf {} +
51+
@rm -rf build/ dist/ .coverage htmlcov/
1652

1753
build: qa clean
54+
@echo "Build prepared."
1855

19-
.PHONY: analyze build clean format lock qa test
56+
.PHONY: analyze build clean format lock qa test coverage help

0 commit comments

Comments
 (0)