-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
67 lines (54 loc) · 1.5 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
PROJECT := esteid
LOCALES := en et lt ru
.PHONY:
help: ## Show this help.
@echo "Usage: make TARGET."
@echo "** Available TARGETs: **"
@sed -ne '/@sed/!s/## //p' $(MAKEFILE_LIST)
.PHONY:
clean: clean-build clean-pyc ## Clean build artifacts and pyc files
.PHONY:
clean-build: ## Clean build artifacts
rm -fr build/
rm -fr dist/
rm -fr *.egg-info
.PHONY:
clean-pyc: ## Clean pyc files
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
find . -name '__pycache__' -exec rm -rf {} +
.PHONY:
lint: ## Run python linters
black --check .
isort --check-only --project=$(PROJECT) .
flake8 $(PROJECT)
pylint $(PROJECT)
.PHONY:
test: ## Run all python tests in the current virtual env
PYTHONPATH=. pytest
.PHONY:
test-one-fail: ## Run python tests in the current virtual env until first failure
PYTHONPATH=. pytest -x
.PHONY:
test-all: ## Run tests in all environments with tox
tox
.PHONY:
test-full: lint coverage ## Run linters, tests, and coverage
.PHONY:
coverage: ## Run coverage
PYTHONPATH=. pytest --cov=$(PROJECT) --cov-report html --cov-report term-missing
.PHONY:
fmt: ## Format python code
black .
isort --project=$(PROJECT) .
.PHONY:
i18n-collect: ## Collect translatable strings
@cd esteid && \
for locale in $(LOCALES); do \
mkdir -p locale/$$locale/LC_MESSAGES \
&& ../manage.py makemessages -l $$locale -e py; \
done
.PHONY:
i18n-compile: ## Compile translatable strings
cd esteid && ../manage.py compilemessages