-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
97 lines (73 loc) · 2.22 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
.PHONY: docs test
VIRTUALENV = $(shell which virtualenv)
PYTHONEXEC = $(shell which python3.6)
DOCKER_VOL = '/var/run/docker.sock:/var/run/docker.sock'
PIMAGENAME = 'dnvrc/pegasus:public'
DIMAGENAME = 'dnvrc/pegasus:latest'
bandit:
. venv/bin/activate; pip install bandit==1.0.1
. venv/bin/activate; bandit -r src/
bitinfocharts: compile
. venv/bin/activate; $(PYTHONEXEC) src/api/bitinfochart/__init__.py
clean:
rm .coverage || true
rm -rf .cache
rm -rf .eggs
rm -rf .tox
rm -rf *.egg-info/
rm -rf build
rm -rf dist
rm -rf htmlcov
rm -fr venv
find . -type d -name '__pycache__' | xargs rm -rf
find . -name "*.pyc" -type f -print0 | xargs -0 /bin/rm -rf
compile:
. venv/bin/activate; $(PYTHONEXEC) setup.py build install
console:
. venv/bin/activate; $(PYTHONEXEC)
corr_0725: compile
. venv/bin/activate; $(PYTHONEXEC) src/models/corr_0725/__init__.py
corr_0725_r:
python setup.py build install
python src/models/corr_0725/markowitz.py
# python src/models/corr_0725/__init__.py
coverage:
. venv/bin/activate; coverage run --source src setup.py test
. venv/bin/activate; coverage html
. venv/bin/activate; coverage report
deps:
. venv/bin/activate; $(PYTHONEXEC) -m pip install -r requirements.txt
docker_build:
docker build -t pegasus:latest .
docker_install:
pip3 install graphviz
python3 -m pip install -r requirements.txt
python3 setup.py install
install: clean venv deps
. venv/bin/activate; $(PYTHONEXEC) setup.py install
# DB Migration tasks -----------------------------------------------------------
current:
alembic current
history:
alembic history --verbose
migrate:
alembic upgrade head
reset:
alembic downgrade base
upgrade:
alembic upgrade +1
rollback:
alembic downgrade -1
schema:
alembic upgrade head --sql > ./alembic/schema.sql
# DB Migration tasks -----------------------------------------------------------
lint:
. venv/bin/activate; pip install flake8==3.3.0
. venv/bin/activate; $(PYTHONEXEC) -m flake8 --ignore=F401,E501,E731 src/
test:
. venv/bin/activate; $(PYTHONEXEC) setup.py test
tox:
. venv/bin/activate; pip install aiokafka==0.3.1 pytest==3.2.3 pytest-cov==2.5.1 responses==0.5.1 minimock==1.2.8 mock==2.0.0
. venv/bin/activate; tox
venv:
$(VIRTUALENV) -p $(PYTHONEXEC) venv