forked from nutanix/calm-dsl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
64 lines (50 loc) · 2.05 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
62
63
64
dev:
# Setup our python3 based virtualenv
# This step assumes python3 is installed on your dev machine
[ -f venv/bin/python3 ] || (virtualenv -p python3 venv && \
venv/bin/pip3 install --upgrade pip setuptools)
venv/bin/pip3 install -r requirements.txt -r dev-requirements.txt
venv/bin/python3 setup.py develop
test: dev
venv/bin/calm update cache
venv/bin/py.test -v --durations 10 -m "not slow" --ignore=examples/
test-all: test
venv/bin/py.test -v -m "slow"
gui: dev
# Setup Jupyter
venv/bin/pip3 install -r gui-requirements.txt
venv/bin/jupyter contrib nbextension install --user
venv/bin/jupyter nbextensions_configurator enable --user
venv/bin/jupyter nbextension install --py jupyter_dashboards --sys-prefix
venv/bin/jupyter nbextension enable --py jupyter_dashboards --sys-prefix
clean:
[ ! -d build/ ] || rm -r build/
[ ! -d dist/ ] || rm -r dist/
[ ! -d *.egg-info/ ] || rm -r *.egg-info/
[ -S /var/run/docker.sock ] && \
docker ps -aq --no-trunc --filter "status=exited" | xargs -r docker rm && \
docker image prune -f
rm -r venv/ && mkdir venv/ && touch venv/.empty
test-verbose: dev
venv/bin/py.test -s -vv
dist:
venv/bin/python3 setup.py bdist_wheel
docker: dist gui
[ -S /var/run/docker.sock ] && \
docker build --rm -t ideadevice/calm-dsl .
black:
black --exclude '/(\.eggs|\.git|\.hg|\.mypy_cache|\.nox|\.tox|venv|_build|buck-out|build|dist|examples)/' .
run:
docker run -it -p 8888:8888 ideadevice/calm-dsl
_init_centos:
# Lets get python3 in
rpm -q epel-release || sudo yum -y install epel-release
# Not needed: This has a modern git
# rpm -q wandisco-git-release || sudo yum install -y http://opensource.wandisco.com/centos/7/git/x86_64/wandisco-git-release-7-2.noarch.rpm || :
#sudo yum update -y git || :
sudo yum makecache
# Install docker
which docker || { curl -fsSL https://get.docker.com/ | sh; sudo systemctl start docker; sudo systemctl enable docker; sudo usermod -aG docker $(whoami); }
rpm -q python36 || sudo yum -y install python36 python-pip python3-devel
# Install virtual env
sudo pip install -U virtualenv