generated from pmbrull/python-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
36 lines (29 loc) · 1.1 KB
/
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
.DEFAULT_GOAL := help
PROJECT_DIR := gitdb/
.PHONY: help
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[35m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: install
install: ## Install the python module to the current environment
python -m pip install -e .
.PHONY: install_dev
install_dev: ## Install the python module with dev dependencies
python -m pip install -e ".[dev]"
.PHONY: precommit_install
precommit_install: ## Install the project's precommit hooks from .pre-commit-config.yaml
@echo "Installing pre-commit hooks"
@echo "Make sure to first run install_dev first"
pre-commit install
.PHONY: lint
lint: ## Run linting
ruff check $(PROJECT_DIR)
.PHONY: py_format
py_format: ## Run black and isort to format the Python codebase
pycln $(PROJECT_DIR)
isort $(PROJECT_DIR) --profile black --multi-line 3
black $(PROJECT_DIR)
.PHONY: py_format_check
py_format_check: ## Check if Python sources are correctly formatted
pycln $(PROJECT_DIR) --diff
isort $(PROJECT_DIR) --check-only --profile black --multi-line 3
black $(PROJECT_DIR) --check --diff