forked from sphinx-gallery/sphinx-gallery
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·48 lines (43 loc) · 1.77 KB
/
install.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
#!/bin/bash
#
# License: 3-clause BSD
set -eo pipefail
python -m pip install --upgrade pip setuptools wheel
PLATFORM=$(python -c "import platform; print(platform.system())")
if [ "$DISTRIB" == "mamba" ]; then
conda config --set solver libmamba
# memory_profiler is unreliable on macOS and Windows (lots of zombie processes)
if [ "$PLATFORM" != "Linux" ]; then
conda remove -y memory_profiler
fi
PIP_DEPENDENCIES="jupyterlite-sphinx>=0.8.0,<0.9.0 jupyterlite-pyodide-kernel<0.1.0 libarchive-c numpy"
elif [ "$DISTRIB" == "minimal" ]; then
PIP_DEPENDENCIES=""
elif [ "$DISTRIB" == "pip" ]; then
PIP_DEPENDENCIES="-r dev-requirements.txt pyqt6"
# No VTK on Python 3.12 pip yet
if [[ "$(python -c "import sys; print(sys.version)")" != "3.12"* ]]; then
PIP_DEPENDENCIES="$PIP_DEPENDENCIES vtk"
fi
else
echo "invalid value for DISTRIB environment variable: $DISTRIB"
exit 1
fi
# Sphinx version
if [ "$SPHINX_VERSION" == "dev" ]; then
PIP_DEPENDENCIES="--upgrade --pre https://api.github.com/repos/sphinx-doc/sphinx/zipball/master --default-timeout=60 --extra-index-url 'https://pypi.anaconda.org/scientific-python-nightly-wheels/simple' $PIP_DEPENDENCIES"
elif [ "$SPHINX_VERSION" != "default" ]; then
PIP_DEPENDENCIES="sphinx==${SPHINX_VERSION}.* $PIP_DEPENDENCIES"
fi
set -x
pip install $EXTRA_ARGS $PIP_DEPENDENCIES pytest pytest-cov coverage pydata-sphinx-theme -e .
set +x
# "pip install pygraphviz" does not guarantee graphviz binaries exist
if [[ "$DISTRIB" != "mamba" ]]; then
if [[ "$PLATFORM" == "Linux" ]]; then
sudo apt install graphviz
else # could use brew on macOS pip but it'll take time to install
echo "Removing pygraphviz on $PLATFORM when DISTRIB=$DISTRIB"
pip uninstall -y graphviz
fi
fi