-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
51 lines (38 loc) · 1.33 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
SHELL := /bin/bash
.PHONY: help
# Add the following 'help' target to your Makefile
# And add help text after each target name starting with '\#\#'
# https://gist.github.com/prwhite/8168133
help: ## Show help
@echo -e "$$(grep -hE '^\S+:.*##' $(MAKEFILE_LIST) | sed -e 's/:.*##\s*/:/' -e 's/^\(.\+\):\(.*\)/\\x1b[36m\1\\x1b[m:\2/' | column -c2 -t -s :)"
# https://stackoverflow.com/questions/4728810/makefile-variable-as-prerequisite
guard-%:
@ if [ "${${*}}" = "" ]; then \
echo "Environment variable $* not set"; \
exit 1; \
fi
clean-pyc:
@find . -name '.pytest_cache' -exec rm -rf {} +
@find . -name '*.pyc' -exec rm -f {} +
@find . -name '*.pyo' -exec rm -f {} +
@find . -name '*~' -exec rm -f {} +
@find . -name '*.egg-info' -exec rm -rf {} +
@find . -name 'pip-wheel-metadata' -exec rm -rf {} +
clean-build:
@rm -f -r build/
@rm -f -r dist/
@rm -f -r .eggs
@rm -f -r *.egg-info
clean: clean-pyc clean-build ## Clear all
test: clean-pyc ## Run tests
@pytest -v -s
build: test ## Build project
@poetry build
install: ## Install project and its dependencies
@poetry install
publish: build ## Deploy distribution package
@poetry publish --repository pypi
# @twine upload dist/*
publish-test: build ## Deploy distribution package to PyPi-Test
@poetry publish --repository testpypi
# @twine upload --repository testpypi dist/*