-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
57 lines (45 loc) · 1.47 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
.PHONY: test test-github jupyter install
SHELL := /bin/bash
repo=$(shell basename $(CURDIR))
# determines how tests are run. if "mock", tests are run
# using mocked responses. if "default", tests run against
# a live instance
client="mock"
chosen_tests=""
test:
source $(CURDIR)/venv/bin/activate && \
interrogate -c pyproject.toml -v . -f 100 && \
python3 -m coverage run -m pytest --failed-first -x -k $(chosen_tests) --client $(client) && \
python3 -m coverage html && \
deactivate
-open htmlcov/index.html
# set up jupyter dev kernel
jupyter:
-deactivate
-yes | jupyter kernelspec uninstall $(repo)
source $(CURDIR)/venv/bin/activate && \
python3 -m ipykernel install --user --name $(repo) && \
deactivate
# install in a virtual env with all extras
install:
@echo "Installing deeporigin in editable mode in a venv..."
@python3 -m venv venv
@source $(CURDIR)/venv/bin/activate && \
pip install -q -e .[test,jupyter,docs] && \
deactivate
@-mkdir -p ~/.deeporigin
@test -f ~/.deeporigin/deeporigin || ln -s $(CURDIR)/venv/bin/deeporigin ~/.deeporigin/deeporigin
build-docs:
bash scripts/build_docs.sh
serve-docs:
@echo "Serving docs locally..."
@source $(CURDIR)/venv/bin/activate && \
mkdocs serve && \
deactivate
test-github:
python3 -m coverage run -m pytest -k $(chosen_tests) --client $(client)
deploy-docs:
@echo "Deploying to live environment..."
@source $(CURDIR)/venv/bin/activate && \
mkdocs gh-deploy && \
deactivate