-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
85 lines (63 loc) · 2.42 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
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
83
84
85
#######################################################
# Project setup & housekeeeping #
#######################################################
clean:
@echo "Cleaning up Python compiled directories"
@find . -type d -name "__pycache__" -exec rm -rf {} +
@find . -type d -name "htmlcov" -exec rm -rf {} +
@find . -type d -name "*.egg-info" -exec rm -rf {} +
@find . -type d -name ".mypy_cache" -exec rm -rf {} +
@find . -type d -name ".pytest_cache" -exec rm -rf {} +
@find . -type f -name "*.py[co]" -exec rm -f {} +
@find . -type f -name "*.pyo" -exec rm -f {} +
@poetry run pre-commit clean
#######################################################
# Build & CICD #
#######################################################
build:
@echo "Building the project"
@poetry build
requirements.txt:
@echo "Creating requirements.txt"
@poetry export --output requirements.txt
check-next-version:
@echo "Checking next version with semantic-release"
@poetry run semantic-release -vv --noop version --print
#######################################################
# Linting & Formatting #
#######################################################
sort-imports:
@echo "Sorting imports"
@poetry run isort .
lint:
@echo "Running ruff linter"
@poetry run ruff check .
format:
@echo "Running ruff formatter"
@poetry run ruff format .
check-types:
@echo "Type checking with mypy"
@poetry run mypy .
pre-commit-setup:
@echo "Setting up pre-commit"
@poetry run pre-commit install --hook-type pre-commit --hook-type pre-push --hook-type commit-msg
pre-commit:
@echo "Running pre-commit"
@poetry run pre-commit run --all-files --color always && \
poetry run pre-commit run --hook-stage pre-push --all-files --color always && \
poetry run pre-commit run --hook-stage push --all-files --color always
#######################################################
# Testing #
#######################################################
test:
@echo "Running tests"
@poetry run pytest -vv -s --cov=supabase_pydantic --cov-report=term-missing
coverage:
@echo "Running tests with coverage"
@poetry run pytest --cov=supabase_pydantic --cov-report=term-missing --cov-report=html --cov-config=pyproject.toml
#######################################################
# Documentation #
#######################################################
serve-docs:
@echo "Building documentation"
@poetry run mkdocs serve