-
Notifications
You must be signed in to change notification settings - Fork 75
/
Makefile
37 lines (28 loc) · 923 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
#!/bin/bash
VENV = ./activate_venv
DIR := $(shell pwd)
export PYTHONPATH := $(DIR)/src
# Virtual environment commands
venv:
python -m venv ./venv || true
. $(VENV); python -m pip install pip wheel --upgrade;
. $(VENV); python -m pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu
. $(VENV); python -m pip install -r requirements-dev.txt
update:
. $(VENV); python -m pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu
. $(VENV); python -m pip install -U -r requirements-dev.txt
# Test commands
test:
. $(VENV); pytest --cov-report term --cov=src
# Examples commands
jupyter-examples:
. $(VENV); cd examples && jupyter notebook
update-examples:
. $(VENV);
for f in $(PWD)/examples/*.ipynb; do \
jupyter nbconvert --to notebook --execute $$f --inplace; \
done
# Build commands
build: venv
. $(VENV); python setup.py sdist bdist_wheel
.PHONY: venv