-
Notifications
You must be signed in to change notification settings - Fork 106
/
Makefile
59 lines (43 loc) · 1.24 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
.PHONY: check-black check-isort check-pylint static-analysis test sdist wheel release pre-release clean
PATH_DADMIN := $(shell which django-admin)
sdist:
python setup.py sdist
wheel:
python setup.py bdist_wheel --universal
release: clean sdist wheel
twine upload dist/*
pre-release: sdist wheel
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
clean:
find . | grep -E '(__pycache__|\.pyc|\.pyo$)' | xargs rm -rf
rm -rf build
rm -rf dist
rm -rf *.egg-info
check-black:
@echo "--> Running black checks"
@black --check --diff .
check-isort:
@echo "--> Running isort checks"
@isort --check-only .
check-pylint:
@echo "--> Running pylint checks"
@pylint `git ls-files '*.py'`
check-yamllint:
@echo "--> Running yamllint checks"
@yamllint .
lint: check-black check-isort check-pylint check-yamllint
# Format code
.PHONY: fmt
fmt:
@echo "--> Running isort"
@isort .
@echo "--> Running black"
@black .
# Test
.PHONY: test
test:
@echo "--> Running tests"
PYTHONWARNINGS=all PYTHONPATH=".:tests:${PYTHONPATH}" django-admin test --settings=tests.settings
coverage:
@echo "--> Running coverage"
PYTHONWARNINGS=all PYTHONPATH=".:tests:${PYTHONPATH}" coverage run --source='.' $(PATH_DADMIN) test --settings=tests.settings