-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
69 lines (51 loc) · 1.89 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
68
69
VIRTUAL_ENV ?= .venv
SHELL := /bin/bash
.PHONY: help install docs redoc clean test
define HELPTEXT
Please use "make <target>" where <target> is one of:
install:
Install this project and its dependencies into a virtual environment at $(VIRTUAL_ENV)
docs:
Build this project's documentation locally in docs/build
redoc:
Build the ActionProvider OpenAPI Redoc Spec
clean:
Remove any built artifacts or environments
test:
Run the full suite of tests
poetry.lock:
Generate this project's poetry.lock file
endef
export HELPTEXT
help:
@echo "$$HELPTEXT"
install:
python -m venv $(VIRTUAL_ENV)
$(VIRTUAL_ENV)/bin/python -m pip install --upgrade pip setuptools wheel
$(VIRTUAL_ENV)/bin/python -m pip install --upgrade -rrequirements/test/requirements.txt
$(VIRTUAL_ENV)/bin/python -m pip install --editable .[flask]
# Ensure that pre-commit and tox are available.
# The "source && <command> --version" syntax allows commands
# to be installed either globally or locally.
source $(VIRTUAL_ENV)/bin/activate && pre-commit --version || $(VIRTUAL_ENV)/bin/python -m pip install pre-commit
source $(VIRTUAL_ENV)/bin/activate && tox --version || $(VIRTUAL_ENV)/bin/python -m pip install tox
# Install pre-commit as a git hook.
source $(VIRTUAL_ENV)/bin/activate && pre-commit install
docs:
# Run tox, whether it's installed globally or locally in the virtual environment.
source $(VIRTUAL_ENV)/bin/activate && tox run -e docs
redoc:
npx @redocly/cli build-docs --output index.html actions_spec.openapi.yaml
clean:
rm -rf $(VIRTUAL_ENV)
find . -name "*.pyc" -delete
rm -rf *.egg-info/
rm -rf dist/
rm -f .coverage
rm -rf .mypy_cache/
rm -rf .pytest_cache/
rm -rf .slyp_cache/
rm -rf docs/build/
test:
# Run tox, whether it's installed globally or locally in the virtual environment.
source $(VIRTUAL_ENV)/bin/activate && tox run-parallel