-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
67 lines (54 loc) · 1.78 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
.PHONY: test test-github jupyter install
SHELL := /bin/bash
uname=$(shell uname -s)
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=""
responses="pass"
test:
ifeq ($(client), "mock")
$(eval n_workers=1)
else
$(eval n_workers="auto")
endif
@source $(CURDIR)/venv/bin/activate && \
interrogate -c pyproject.toml -v . -f 100 && \
python3 -m coverage run -m pytest -x -n $(n_workers) --failed-first -k $(chosen_tests) --client $(client) --responses $(responses) && \
python3 -m coverage html && \
deactivate
# 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 --upgrade pip && \
pip install -e .[lint,test,dev,docs,plots] && \
deactivate
@-mkdir -p ~/.deeporigin
@test -f ~/.deeporigin/deeporigin || ln -s $(CURDIR)/venv/bin/deeporigin ~/.deeporigin/deeporigin
docs-build:
bash scripts/build_docs.sh
docs-serve:
@echo "Serving docs locally..."
@source $(CURDIR)/venv/bin/activate && \
mkdocs serve && \
deactivate
docs-deploy:
@echo "Deploying to live environment..."
@source $(CURDIR)/venv/bin/activate && \
mkdocs gh-deploy && \
deactivate
test-github:
python3 -m coverage run -m pytest -k $(chosen_tests) --client $(client)
test-github-live:
python3 -m coverage run -m pytest --ignore=tests/test_config.py --ignore=tests/test_context.py --client default -n "auto"