-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
55 lines (41 loc) · 1020 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
50
51
52
53
54
55
SHELL := /bin/bash
out_dir ?= ./build
project_slug ?= component-hub
poetry := $(shell command -v poetry 2>/dev/null)
.PHONY: all
all: setup hub
.PHONY: setup
setup:
ifndef poetry
$(error "Poetry not in path, check installation instructions on https://python-poetry.org/docs/#installation")
endif
$(poetry) install
.PHONY: hub
hub:
$(poetry) run component-hub make && \
cd $(out_dir)/$(project_slug) && \
git add . && \
git commit -m "First commit" && \
make html
.PHONY: clean
clean:
rm -rf $(out_dir)
###
### Python lints
###
.PHONY: lint lint_flake8 lint_pylint lint_bandit lint_black
RUN_COMMAND = $(poetry) run
lint_flake8:
$(RUN_COMMAND) flake8 --config pyproject.toml
lint_pylint:
$(RUN_COMMAND) pylint component_hub
lint_bandit:
$(RUN_COMMAND) bandit -r component_hub
lint_mypy:
$(RUN_COMMAND) mypy --ignore-missing-imports component_hub
lint_black:
$(RUN_COMMAND) black --check .
lint: lint_flake8 lint_pylint lint_bandit lint_mypy lint_black
.PHONY: test
test:
$(RUN_COMMAND) pytest