forked from linode/linode-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
88 lines (69 loc) · 1.63 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#
# Makefile for more convenient building of the Linode CLI and its baked content
#
INTEGRATION_TEST_PATH :=
TEST_CASE_COMMAND :=
ifdef TEST_CASE
TEST_CASE_COMMAND = -k $(TEST_CASE)
endif
SPEC_VERSION ?= latest
ifndef SPEC
override SPEC = $(shell ./resolve_spec_url ${SPEC_VERSION})
endif
.PHONY: install
install: check-prerequisites requirements build
pip3 install --force dist/*.whl
.PHONY: bake
bake: clean
python3 -m linodecli bake ${SPEC} --skip-config
cp data-3 linodecli/
.PHONY: build
build: clean bake
python3 -m build --wheel --sdist
.PHONY: requirements
requirements:
pip3 install -r requirements.txt -r requirements-dev.txt
.PHONY: lint
lint: build
pylint linodecli
isort --check-only linodecli tests
autoflake --check linodecli tests
black --check --verbose linodecli tests
twine check dist/*
.PHONY: check-prerequisites
check-prerequisites:
@ pip3 -v >/dev/null
@ python3 -V >/dev/null
.PHONY: clean
clean:
rm -f linodecli/data-*
rm -f linode-cli.sh baked_version
rm -f data-*
rm -rf dist linode_cli.egg-info build
.PHONY: testunit
testunit: export LINODE_CLI_TEST_MODE = 1
testunit:
pytest -v tests/unit
.PHONY: testint
testint:
pytest tests/integration/${INTEGRATION_TEST_PATH} ${TEST_CASE_COMMAND} --disable-warnings
.PHONY: testall
testall:
pytest tests
# Alias for unit; integration tests should be explicit
.PHONY: test
test: testunit
.PHONY: black
black:
black linodecli tests
.PHONY: isort
isort:
isort linodecli tests
.PHONY: autoflake
autoflake:
autoflake linodecli tests
.PHONY: format
format: black isort autoflake
@PHONEY: smoketest
smoketest:
pytest -m smoke tests/integration --disable-warnings