This repository has been archived by the owner on Dec 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
61 lines (50 loc) · 1.81 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
.DEFAULT_GOAL := help
###################################################################################################
#
# HELP
#
###################################################################################################
# COLORS
RED := $(shell tput -Txterm setaf 1)
GREEN := $(shell tput -Txterm setaf 2)
WHITE := $(shell tput -Txterm setaf 7)
YELLOW := $(shell tput -Txterm setaf 3)
RESET := $(shell tput -Txterm sgr0)
# Add the following 'help' target to your Makefile
# And add help text after each target name starting with '\#\#'
# A category can be added with @category
HELP_HELPER = \
%help; \
while(<>) { push @{$$help{$$2 // 'targets'}}, [$$1, $$3] if /^([a-zA-Z_\-\%]+)\s*:.*\#\#(?:@([a-zA-Z\-\%]+))?\s(.*)$$/ }; \
print "usage: make [target]\n\n"; \
for (sort keys %help) { \
print "${WHITE}$$_:${RESET}\n"; \
for (@{$$help{$$_}}) { \
$$sep = " " x (32 - length $$_->[0]); \
print " ${YELLOW}$$_->[0]${RESET}$$sep${GREEN}$$_->[1]${RESET}\n"; \
}; \
print "\n"; }
help: ##@help Prints help
@perl -e '$(HELP_HELPER)' $(MAKEFILE_LIST)
###################################################################################################
#
# TASKS
#
###################################################################################################
.PHONY: check_style
check_style: ## Check Python code style
pycodestyle *.py brume --config .pycodestyle
flake8 *.py brume --config .pycodestyle
pylint --rcfile .pylintrc brume/*.py || true
.PHONY: clean
clean: ## Clean temporary and build files
rm -rf .cache build dist .eggs *.egg-info .pytest_cache
.PHONY: upload
publish: clean ## Create Python package and upload to PyPI
python setup.py publish
.PHONY: build
build: clean ## Build project
python setup.py build install
.PHONY: test
test: build ## Run tests
python setup.py test