forked from AdvPyS22/EEGToolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
doc_and_build.sh
51 lines (40 loc) · 1.21 KB
/
doc_and_build.sh
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
#!/bin/bash
# This script will generate a new
# html documentation as well as
# build a new package binary
# ----------------------------------------
# Make an HTML documentation using pydoc
# ----------------------------------------
# make a docs folder if not yet present
if [[ ! -d ./docs ]]; then
mkdir -p ./docs
fi
# run pdoc
pdoc ./EEGToolkit/ --output-dir ./docs --html --force
echo "Documentation generated successfully!"
# ----------------------------------------
# Build a new binary
# ----------------------------------------
# first make new requirements
pipreqs ./EEGToolkit --force --savepath ./requirements.txt
echo "Requirements generated successfully!"
# now build
python -m build .
echo "Binary generated successfully!"
# ----------------------------------------
# Optional additional steps
# ----------------------------------------
while [[ $# -gt 0 ]]; do
case $1 in
-d|--dist)
for i in $(ls dist); do latest=$i; done
twine upload --repository testpypi ./dist/$latest
shift # past argument
;;
-i|--install)
for i in $(ls dist); do latest=$i; done
pip install ./dist/$latest
shift # past argument
;;
esac
done