-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (31 loc) · 972 Bytes
/
Copy pathMakefile
File metadata and controls
36 lines (31 loc) · 972 Bytes
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
PYTHON := .venv/bin/python
.PHONY: black-check black-reformat clean check isort-check isort-reformat reformat ruff-check \
ruff-fix setup test
# Setup
.venv/.installed: requirements.txt requirements-dev.txt requirements-test.txt
python3 -m venv .venv
.venv/bin/pip install --upgrade pip
.venv/bin/pip install -r requirements.txt
.venv/bin/pip install -r requirements-dev.txt
.venv/bin/pip install -r requirements-test.txt
touch .venv/.installed
setup: .venv/.installed
# Formatting and linting
black-check:
@$(PYTHON) -m black --check --diff .
black-reformat:
@$(PYTHON) -m black .
isort-check:
@$(PYTHON) -m isort --check-only --diff .
ruff-check:
@$(PYTHON) -m ruff check .
ruff-fix:
@$(PYTHON) -m ruff check --fix .
check: black-check isort-check ruff-check
reformat: black-reformat isort-reformat ruff-fix
# Unit testing
test:
@$(PYTHON) -m pytest
# Cleanup
clean:
find . -type f -name "*.pyc" -delete && find . -type d -name "__pycache__" -delete