-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
64 lines (41 loc) · 1.59 KB
/
Makefile
File metadata and controls
64 lines (41 loc) · 1.59 KB
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
#! /usr/bin/env make
VENV_BIN ?= python3 -m venv
PYTHON_CMD ?= python3
PIP_CMD ?= pip3
VENV_DIR ?= venv
VENV_ACTIVATE = $(VENV_DIR)/bin/activate
VENV_RUN = . $(VENV_ACTIVATE)
# Application path
APP_ROOT_PATH := ./code/braze
UNIT_TESTS_PATH := ./code/tests/unit
usage: ## Show this help
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/:.*##\s*/##/g' | awk -F'##' '{ printf "%-40s %s\n", $$1, $$2 }'
$(VENV_ACTIVATE): setup.py
test -d $(VENV_DIR) || $(VENV_BIN) $(VENV_DIR)
$(VENV_RUN); $(PIP_CMD) install --upgrade pip setuptools wheel plux
touch $(VENV_ACTIVATE)
venv: $(VENV_ACTIVATE) ## Create a new (empty) dev virtual environment
# Install ONLY dev libraries
install: venv ## Install all dependencies for dev environment
$(VENV_RUN); $(PIP_CMD) install -r requirements.txt
$(VENV_RUN); $(PIP_CMD) install -r requirements-build.txt
$(VENV_RUN); $(PIP_CMD) install -r requirements-test.txt
test-unit: venv ## Run the unit tests
$(VENV_RUN); export PYTHONPATH=${APP_ROOT_PATH} \
&& pytest --cov-report term-missing --cov-config=.coveragerc --cov=${APP_ROOT_PATH} ${UNIT_TESTS_PATH} -s -vv
build: venv clean-dist
$(VENV_RUN); $(PYTHON_CMD) -m build
$(VENV_RUN); twine check dist/*
publish: venv
$(VENV_RUN); twine upload dist/*
clean: ## Clean up (python dependencies, downloaded infrastructure code)
rm -f .coverage
rm -rf .filesystem
rm -rf build/
rm -rf dist/
rm -rf *.egg-info
rm -rf $(VENV_DIR)
clean-dist: ## Clean up python distribution directories
rm -rf dist/ build/
rm -rf code/*.egg-info
.PHONY: usage install tests-unit build clean clean-dist