-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
49 lines (40 loc) · 956 Bytes
/
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
.DEFAULT_GOAL := build
.PHONY: build lint test docs package deploy
PROJ_SLUG = xyzcad
SHELL = bash
version=$(shell git describe --tags --abbrev=0)
build:
echo "__version__ = \"$(version)\"" > ./$(PROJ_SLUG)/_version.py
poetry version $(version)
poetry build
lint:
poetry run black --check .
poetry run isort --check .
test: clean
mkdir -p build
poetry run pytest tests/
docs:
poetry run sphinx-apidoc -f -o ./docs/source/ ./$(PROJ_SLUG)
cd docs && poetry run make html
package: clean docs
poetry build
publish:
poetry publish
clean:
echo "__version__ = \"0.0.0+devel\"" > ./$(PROJ_SLUG)/_version.py
poetry version 0.0.0+devel
rm -rf .pytest_cache \
rm -rf dist \
rm -rf build \
rm -rf __pycache__ \
rm -rf $(PROJ_SLUG)/__pycache__ \
rm -rf tests/__pycache__
#rm -rf docs/build \
rm -rf *.egg-info \
rm -rf docs/source/modules \
rm -rf htmlcov \
rm -rf meta\
rm -rf output
reformat:
poetry run isort .
poetry run black .