-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathMakefile
46 lines (36 loc) · 890 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
SHELL=/bin/bash
ENV_FILE=.env
PYTHON=python3
PYTHON_VENV=.venv
TOX_ARGS=
PYTEST_ARGS=-v -rsx
.PHONY: clean test test_integration lint
# helper
$(ENV_FILE):
cp .env-example $(ENV_FILE)
$(PYTHON_VENV):
rm -rf $(PYTHON_VENV) && \
$(PYTHON) -m venv $(PYTHON_VENV) && \
. $(PYTHON_VENV)/bin/activate && \
pip install -e .[dev]
clean:
rm -rf $(PYTHON_VENV)
rm -rf test_data
rm -rf .tox
rm -rf .artifacts
# tests
test: | $(ENV_FILE) $(PYTHON_VENV)
. $(PYTHON_VENV)/bin/activate && \
. $(ENV_FILE) && \
tox $(TOX_ARGS) -- -m "not integration" $(PYTEST_ARGS)
test_integration: | $(ENV_FILE) $(PYTHON_VENV)
. $(PYTHON_VENV)/bin/activate && \
. $(ENV_FILE) && \
tox $(TOX_ARGS) -- -m "integration" $(PYTEST_ARGS)
# lint
lint:
docker run --rm -e LINT_FOLDER_PYTHON=divio_cli -v $(CURDIR):/app divio/lint /bin/lint ${ARGS}
# build
build:
pip install -U build
python -m build