-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
112 lines (88 loc) · 3.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
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
104
105
106
107
108
109
110
111
112
.ONESHELL:
SHELL=/bin/bash
.SHELLFLAGS = -e -c
UNAME := $(shell uname 2>/dev/null || echo Windows)
ifeq ($(UNAME),Linux)
endif
ifeq ($(UNAME),Darwin)
endif
help:
echo "$(MAKE) install # Rebuild and reinstall sphinx_needs_data_explorer"
echo "$(MAKE) installx # Reinstall sphinx_needs_data_explorer in active virtual environment"
echo "$(MAKE) html # Build sphinx_needs_data_explorer documentation"
echo "$(MAKE) webserver # Run webserver hosting sphinx_needs_data_explorer documentation in docker container"
echo "$(MAKE) show # View the documentation for sphinx_needs_data_explorer, which is hosted on a server running nginx, in a web browser"
echo "$(MAKE) show-session # View stored sesion"
helpx:
echo "$(MAKE) prep-release # Prepare release data"
echo "$(MAKE) upload-package # Uplaod package to PYPI"
$(VERBOSE).SILENT:
echo
install:
rm -rf build dist doc/build
poetry install
prep-release:
rm -rf build dist doc/build
poetry install
# poetry build
poetry build -f sdist
tar -tf dist/*.tar.gz
installx:
pip uninstall sphinx-needs-data-explorer -y
pip install dist/sphinx_needs_data_explorer*.whl
html:
source doc/.venv/bin/activate
$(MAKE) -C doc clean html
WEBSERVERPORT=8080
webserver:
docker ps | awk '$$NF=="sphinx_needs_data_explorer"{print "docker stop "$$1}' | bash
sleep 1
docker run -it --rm -d -p $(WEBSERVERPORT):80 --name sphinx_needs_data_explorer -v $$PWD/doc/build/html:/usr/share/nginx/html nginx
show:
open http://localhost:$(WEBSERVERPORT)
ifeq ($(UNAME),Darwin)
gshow:
open -a '/Applications/Google Chrome.app' http://localhost:$(WEBSERVERPORT)
gshowx:
open -a '/Applications/Google Chrome.app' http://localhost:$(WEBSERVERPORT)/_static/sphinx_needs_data_explorer.html
endif
show-session:
open "http://localhost:$(WEBSERVERPORT)/_static/sphinx_needs_data_explorer.html?type=any&filter=&id=F00016+-+Title+of+%27F00016%27&layout=DU&view=2&viewModeMaxDepth=2&mode=0"
-include ../tests.mak
new-install:
$(eval VENV=.venv)
python3 -m venv $(VENV)
source $(VENV)/bin/activate
python -m pip install --upgrade pip
pip install poetry
echo source $(VENV)/bin/activate
test-package-cur:
$(MAKE) test-package BRANCH=`git branch | awk '$$1=="*"{print $$2}'`
test-package:
$(eval WDIR=/tmp/test)
$(eval BRANCH=main)
mkdir -p $(WDIR)
rm -rf $(WDIR)/*
cd $(WDIR)
git clone -b $(BRANCH) --single-branch \
https://github.com/mi-parkes/sphinx-needs-data-explorer.git
cd sphinx-needs-data-explorer
# poetry install --only test,docs
poetry install
poetry build
poetry run task doc
test-package-show:
$(eval WDIR=/tmp/test)
cd $(WDIR)/sphinx-needs-data-explorer
$(MAKE) webserver show
show-package:
tar -tvf dist/sphinx_needs_data_explorer-*.tar.gz
clean-dc:
docker images | awk '$$1=="<none>"{print "docker rmi "$$3}' | bash
mindmap:
java -jar $(PLANTUML_PATH) -v \
-tpng doc/source/_static/puml/sphinx_needs_data_explorer.puml \
-o $(CURDIR)/doc/source/images
java -jar $(PLANTUML_PATH) -v \
-tsvg doc/source/_static/puml/sphinx_needs_data_explorer.puml \
-o $(CURDIR)/doc/source/images