Skip to content

Commit 76c30ae

Browse files
committed
install.sh: Switch from pydoctor to pdoc.
1 parent dedb9fb commit 76c30ae

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

install.sh

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ POSITIONAL_ARGS=()
1111
FORCE=false
1212
UNSTABLE=false
1313
PYTHON="/usr/bin/python3"
14-
PYDOC="/usr/bin/pydoc3"
1514

1615

1716
user_check() {
@@ -95,6 +94,10 @@ function apt_pkg_install {
9594
fi
9695
}
9796

97+
function pip_pkg_install {
98+
PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring $PYTHON -m pip install --upgrade "$@"
99+
}
100+
98101
while [[ $# -gt 0 ]]; do
99102
K="$1"
100103
case $K in
@@ -135,7 +138,7 @@ printf "$LIBRARY_NAME Python Library: Installer\n\n"
135138

136139
inform "Checking Dependencies. Please wait..."
137140

138-
PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring $PYTHON -m pip install --upgrade toml
141+
pip_pkg_install toml
139142

140143
CONFIG_VARS=`$PYTHON - <<EOF
141144
import toml
@@ -187,9 +190,9 @@ fi
187190
inform "Installing for $PYTHON_VER...\n"
188191
apt_pkg_install "${APT_PACKAGES[@]}"
189192
if $UNSTABLE; then
190-
PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring $PYTHON -m pip install .
193+
pip_pkg_install .
191194
else
192-
PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring $PYTHON -m pip install --upgrade $LIBRARY_NAME
195+
pip_pkg_install $LIBRARY_NAME
193196
fi
194197
if [ $? -eq 0 ]; then
195198
success "Done!\n"
@@ -230,13 +233,12 @@ fi
230233
231234
printf "\n"
232235
233-
if [ -f "$PYDOC" ]; then
236+
if confirm "Would you like to generate documentation?"; then
237+
pip_pkg_install pdoc
234238
printf "Generating documentation.\n"
235-
$PYDOC -w $LIBRARY_NAME > /dev/null
236-
if [ -f "$LIBRARY_NAME.html" ]; then
237-
cp $LIBRARY_NAME.html $RESOURCES_DIR/docs.html
238-
rm -f $LIBRARY_NAME.html
239-
inform "Documentation saved to $RESOURCES_DIR/docs.html"
239+
$PYTHON -m pdoc $LIBRARY_NAME -o $RESOURCES_DIR/docs > /dev/null
240+
if [ $? -eq 0 ]; then
241+
inform "Documentation saved to $RESOURCES_DIR/docs"
240242
success "Done!"
241243
else
242244
warning "Error: Failed to generate documentation."

0 commit comments

Comments
 (0)