forked from hfern/tf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
52 lines (40 loc) · 1.17 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
HIDE := @
TFPLUGIN_PROTO := tfplugin6.5.proto
POETRY := poetry
MODULE := tf
prepare-venv:
$(HIDE)$(POETRY) install
format:
# Format and sort imports with ruff
$(HIDE)$(POETRY) run ruff format $(MODULE)
$(HIDE)$(POETRY) run ruff check --fix $(MODULE)
test-format:
$(HIDE)$(POETRY) run ruff format $(MODULE) --check
$(HIDE)$(POETRY) run ruff check $(MODULE)
update-tfplugin-proto:
$(HIDE)curl https://raw.githubusercontent.com/opentofu/opentofu/main/docs/plugin-protocol/$(TFPLUGIN_PROTO) > tfplugin.proto
generate-tfproto:
$(HIDE)rm -rf ./tf/gen
$(HIDE)mkdir -p ./tf/gen
$(HIDE)$(POETRY) run python -m grpc_tools.protoc \
-Itf/gen=. \
--python_out=. \
--grpc_python_out=. \
--pyi_out=. \
--proto_path=. \
tfplugin.proto
$(HIDE)echo "" > tf/gen/__init__.py
test-python:
$(HIDE)$(POETRY) run coverage run -m unittest discover
$(HIDE)$(POETRY) run coverage report -m --fail-under=100
test-pyre:
$(HIDE)$(POETRY) run pyre check
test: test-format test-python test-pyre
$(HIDE)echo "All tests passed"
build:
$(HIDE)$(POETRY) build
doc:
$(HIDE)$(POETRY) run sphinx-build -M html ./docs ./docs/_build -W
clean:
$(HIDE)rm -rf ./dist
$(HIDE)rm -rf ./docs/_build