-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
38 lines (28 loc) · 991 Bytes
/
Makefile
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
# Makefile with phony targets
.PHONY: setup lint format setup-hooks
setup: ## Setup Python Environment
@make setup-git-hooks
cp .env.example .env
poetry install
poetry run pip install -e .
setup-ci: ## Setup the environment for CI
curl -sSL https://install.python-poetry.org | POETRY_VERSION=1.4.2 python -
cp .env.example .env
poetry install
test: ## test
@poetry shell
pytest
lint: ## Lint Python Files
@poetry run ruff check .
format: ## Format Python Files
@poetry run ruff check --fix .
build: ## Build
@poetry build
publish: ## Publish to PyPi
@poetry publish
setup-git-hooks: ## Setup Git Hook
@echo "Setting up Git hooks..."
cp .git-hooks/pre-commit .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit
help: ## show help message
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m\033[0m\n"} /^[$$()% a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)