-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
61 lines (49 loc) · 1.44 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
VENV_NAME=.venv
PYTHON=${VENV_NAME}/bin/python3
PIP=${VENV_NAME}/bin/pip
COMMON_VARS ?= PYDEVD_DISABLE_FILE_VALIDATION=1 JUPYTER_PLATFORM_DIRS=1
SUBSTRATUS_BRANCH ?= main
.PHONY: venv
venv:
if [ ! -d "${VENV_NAME}" ]; then python3 -m venv ${VENV_NAME}; fi
.PHONY: install
install: venv
$(COMMON_VARS) ${PIP} install -q -r requirements.txt && \
$(COMMON_VARS) ${PYTHON} -m ipykernel install --user
.PHONY: test
test: install
@logfile="tail_ipyk_output_stream_$$PPID.log"; \
pidfile="tail_ipyk_output_stream_$$PPID.pid"; \
trap 'kill `cat $$pidfile` || true; kill $$tail_pid || true; rm $$pidfile; rm $$logfile;' EXIT; \
${PYTHON} ./tests/utils/tail_ipyk_output_stream.py > $$logfile 2>&1 & \
echo $$! > $$pidfile; \
tail -f $$logfile & \
tail_pid=$$!; \
$(COMMON_VARS) ${VENV_NAME}/bin/pytest -s --branch=$(SUBSTRATUS_BRANCH)
.PHONY: freeze
freeze:
${PYTHON} -m pip freeze > requirements.txt
.PHONY: lint
lint:
${VENV_NAME}/bin/isort ./**/*.py
${VENV_NAME}/bin/black .
# TODO: Add tooling download.
# For now go to: https://github.com/campoy/embedmd
.PHONY: embed
embed:
embedmd -w ./docs/*.md
.PHONY: dev-run
dev-run:
npm start
.PHONY: dev-nb
dev-nb:
jupyter lab --allow-root --ip=0.0.0.0 --NotebookApp.token= --notebook-dir=.
.PHONY: clear-notebooks
clear-notebooks:
./nbconvert/clear-all.sh
.PHONY: convert-notebooks
convert-notebooks:
./nbconvert/convert-all.sh
.PHONY: prepare-release
prepare-release: convert-notebooks
# TODO: More stuff