forked from mkdocstrings/python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·28 lines (24 loc) · 709 Bytes
/
setup.sh
File metadata and controls
executable file
·28 lines (24 loc) · 709 Bytes
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
#!/usr/bin/env bash
set -e
PYTHON_VERSIONS="${PYTHON_VERSIONS-3.7 3.8 3.9 3.10 3.11}"
install_with_pipx() {
if ! command -v "$1" &>/dev/null; then
if ! command -v pipx &>/dev/null; then
python3 -m pip install --user pipx
fi
pipx install "$1"
fi
}
install_with_pipx pdm
if [ -n "${PYTHON_VERSIONS}" ]; then
for python_version in ${PYTHON_VERSIONS}; do
if pdm use -f "python${python_version}" &>/dev/null; then
echo "> Using Python ${python_version} interpreter"
pdm install
else
echo "> pdm use -f python${python_version}: Python interpreter not available?" >&2
fi
done
else
pdm install
fi