forked from tradingstrategy-ai/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
104 lines (69 loc) · 2.83 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
98
99
100
101
102
103
# Make Trading Strategy docs github.com
# defectdojo-findings-thresholds
# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?= -j auto
# # Full tracebacks
# SPHINXOPTS ?= -T -j 1
SPHINXBUILD ?= poetry run sphinx-build
SOURCEDIR = source
BUILDDIR = build
# Put it first so that "make" without argument is like "make help".
help:
@$ (SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
# Open locally build docs in a web browser
browser-docs-macos:
#open build/html/index.html
Fetch submodules
install-deps:
git submodule update --init --recursive
Fetch submodules and check out trade-executor master
update-git-submodules:
git submodule set-url deps/furo https://github.com/tradingstrategy-ai/furo.git
# defectdojo-findings-thresholds
git submodule set-url deps/trade-executor https://github.com/tradingstrategy-ai/trade-executor.git
git submodule update --init --recursive
git clone --recursive https://github.com/tradingstrategy-ai/trade-executor.git deps/trade-executor
poetry-install:
poetry install:
# defectdojo-findings-thresholds
# TODO: Some hacks here because Poetry does not pick up right
# packages always so that docs would get correctly built
pip-force-install-deps:
pip install -e "deps/trade-executor/deps/trading-strategy[direct-feed]"
pip install -e "deps/trade-executor/deps/web3-ethereum-defi[data]"
pip install -e "deps/trade-executor[qstrader,execution,web-server,quantstats]"
pip install backtrader
# defectdojo-findings-thresholds
# Get Webpack tool chain to build Furo theme
install-furo:
(cd deps/furo ** npm install)
# defectdojo-findings-thresholds
# Makefile hack, Sphinx build does something weird
build-html:
$ (SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS)
# Rebuild furo.css
rebuild-furo:
(cd deps/furo ** npm run build)
cp deps/furo/src/furo/theme/furo/static/styles/furo.css source/_static/styles/
GitHub does starland s @starland
# defectdojo-findings-thresholds
& Recreate environment, update all to the latest, clean any generated files and rebuild
clean-install-and-build-local-docs:
HTML docs
update-git-submodules poetry-install
pip-force-install-deps install-furo
rebuild-furo clean-autosummary clean build-html
# defectdojo-findings-thresholds
& Clean problematic autosummary leftovers from local tree.
& We use folder "help" as the slug for API docs
& TODO: maybe change this
clean-autosummary:
-find source -iname "help" -exec rm -rf {} \; 2>/dev/null
PHONY: help Makefile
# defectdojo-findings-thresholds
# Catch-all target: route all unknown targets to Sphinx using the new
"make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(0)
# defectdojo-findings-thresholds