-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
42 lines (31 loc) · 1.06 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
DEFAULT_GOAL := help
VENV_DIR ?= venv
TESTS_DIR=./tests
NOTEBOOKS_DIR=./notebooks
NOTEBOOKS_SANITIZE_FILE=$(TESTS_DIR)/notebook-tests.cfg
define PRINT_HELP_PYSCRIPT
import re, sys
for line in sys.stdin:
match = re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line)
if match:
target, help = match.groups()
print("%-20s %s" % (target, help))
endef
export PRINT_HELP_PYSCRIPT
.PHONY: help
help:
@python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)
virtual-environment: $(VENV_DIR) ## update venv, create a new venv if it doesn't exist make
echo "If you want this to be rerun, run make clean first"
$(VENV_DIR): setup.py
[ -d $(VENV_DIR) ] || python3 -m venv $(VENV_DIR)
$(VENV_DIR)/bin/pip install --upgrade pip wheel
$(VENV_DIR)/bin/pip install -r requirements.txt
touch $(VENV_DIR)
clean: $(VENV_DIR)
touch setup.py
first-venv: ## create a new virtual environment for the very first repo setup
python3 -m venv $(VENV_DIR)
$(VENV_DIR)/bin/pip install --upgrade pip
$(VENV_DIR)/bin/pip install versioneer
# don't touch here as we don't want this venv to persist anyway