-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
43 lines (35 loc) · 1.02 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
help:
@echo "install - install a virtualenv for development and deployment"
@echo "fmt - format source code with black"
@echo "test - run unit tests"
@echo "deploy - deploy all your pipelines"
@echo "clean - remove build, test, and Python artifacts locally"
VENV = venv
PYTHON = $(VENV)/bin/python3
PIP = $(VENV)/bin/pip
.PHONY: venv
venv:
@test -d "venv" || mkdir -p "venv"
@rm -Rf "venv"
@python3 -m venv "venv"
install: upgrade-pip install-tests
upgrade-pip:
$(PIP) install --upgrade pip setuptools
install-tests:
$(PIP) install -r tests/requirements.txt
fmt:
$(PIP) install black
$(PYTHON) -m black .
test:
export PYTHONPATH=".:./src" && \
$(PYTHON) -m pytest tests/
clean:
@rm -fr .tox/
@rm -fr .venv/
@find . -name '*.egg-info' -exec rm -fr {} +
@find . -name "*.py[co]" -o -name .pytest_cache -exec rm -rf {} +
@find . -name '*.egg' -exec rm -f {} +
@find . -name '*.pyc' -exec rm -f {} +
@find . -name '*.pyo' -exec rm -f {} +
@find . -name '*~' -exec rm -f {} +
@find . -name '__pycache__' -exec rm -fr {} +