-
Notifications
You must be signed in to change notification settings - Fork 74
/
Makefile
86 lines (68 loc) · 1.77 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
PYTHON ?= python3
TEST_CASE_COMMAND :=
TEST_SUITE :=
TEST_ARGS :=
LINODE_SDK_VERSION ?= "0.0.0.dev"
VERSION_MODULE_DOCSTRING ?= \"\"\"\nThe version of this linode_api4 package.\n\"\"\"\n\n
VERSION_FILE := ./linode_api4/version.py
ifdef TEST_CASE
TEST_CASE_COMMAND = -k $(TEST_CASE)
endif
ifdef TEST_SUITE
ifneq ($(TEST_SUITE),linode_client)
ifneq ($(TEST_SUITE),login_client)
TEST_COMMAND = models/$(TEST_SUITE)
else
TEST_COMMAND = login_client
endif
else
TEST_COMMAND = linode_client
endif
endif
.PHONY: clean
clean:
mkdir -p dist
rm -r dist
rm -f baked_version
.PHONY: build
build: clean create-version
$(PYTHON) -m build --wheel --sdist
.PHONY: create-version
create-version:
@printf "${VERSION_MODULE_DOCSTRING}__version__ = \"${LINODE_SDK_VERSION}\"\n" > $(VERSION_FILE)
.PHONY: release
release: build
$(PYTHON) -m twine upload dist/*
.PHONY: dev-install
dev-install: clean
$(PYTHON) -m pip install -e ".[dev]"
.PHONY: install
install: clean create-version
$(PYTHON) -m pip install .
.PHONY: black
black:
$(PYTHON) -m black linode_api4 test
.PHONY: isort
isort:
$(PYTHON) -m isort linode_api4 test
.PHONY: autoflake
autoflake:
$(PYTHON) -m autoflake linode_api4 test
.PHONY: format
format: black isort autoflake
.PHONY: lint
lint: build
$(PYTHON) -m isort --check-only linode_api4 test
$(PYTHON) -m autoflake --check linode_api4 test
$(PYTHON) -m black --check --verbose linode_api4 test
$(PYTHON) -m pylint linode_api4
$(PYTHON) -m twine check dist/*
.PHONY: testint
testint:
$(PYTHON) -m pytest test/integration/${TEST_COMMAND} ${TEST_CASE_COMMAND} ${TEST_ARGS}
.PHONY: testunit
testunit:
$(PYTHON) -m pytest test/unit
.PHONY: smoketest
smoketest:
$(PYTHON) -m pytest -m smoke test/integration