-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
28 lines (23 loc) · 898 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
.PHONY: train
jupyter:
export PYTHONPATH=`pwd`; screen .venv/bin/jupyter notebook --ip 0.0.0.0 --port=8109 --no-browser .
browser:
export PYTHONPATH=`pwd`; screen .venv/bin/jupyter notebook --ip 0.0.0.0 --port=8109 .
setup:
virtualenv >/dev/null 2>&1 || python3 -m pip install --user virtualenv
test -d .venv || virtualenv --python=python3.6 .venv
poetry >/dev/null 2>&1 || python3 -m pip install --user poetry
poetry install
.venv/bin/jupyter nbextension enable --py widgetsnbextension
# See https://github.com/sdispater/poetry/issues/100
define get_requirements
import tomlkit
with open('poetry.lock') as t:
lock = tomlkit.parse(t.read())
for p in lock['package']:
if not p['category'] == 'dev':
print(f"{p['name']}=={p['version']}")
endef
export get_requirements
requirements.txt: poetry.lock
.venv/bin/python -c "$$get_requirements" | grep -v pywin > $@