-
Notifications
You must be signed in to change notification settings - Fork 681
/
Makefile
67 lines (55 loc) · 1.13 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
VERSION := $(shell sed -n 's/^ *version.*=.*"\([^"]*\)".*/\1/p' pyproject.toml)
.PHONY: test
test:
coverage run manage.py test
coverage report
.PHONY: tests
tests:
tox
.PHONY: reformat
reformat:
ruff format .
ruff check . --fix
.PHONY: lint
lint:
ruff check .
.PHONY: docs
docs: clean
cd docs && sphinx-build -b html -d _build/doctrees . _build/html
.PHONY: example
example:
cd example && python manage.py runserver
.PHONY: porcelain
porcelain:
ifeq ($(shell git status --porcelain),)
@echo "Working directory is clean."
else
@echo "Error - working directory is dirty. Commit your changes.";
@exit 1;
endif
.PHONY: branch
branch:
ifeq ($(shell git rev-parse --abbrev-ref HEAD),main)
@echo "On branch main."
else
@echo "Error - Not on branch main."
@exit 1;
endif
.PHONY: build
build:
python -m build
twine check dist/*
check-manifest
pyroma .
check-wheel-contents dist
.PHONY: publish
publish: porcelain branch docs build
twine upload dist/*
git tag -a v${VERSION} -m "Release ${VERSION}"
git push origin --tags
.PHONY: clean
clean:
rm -rf build dist src/*.egg-info .coverage*
.PHONY: version
version:
@echo ${VERSION}