- Extend `PYTHON_INSTALL` parsing to handle both comma and newline-separated formats - Update documentation to reflect new multiline support for `PYTHON_INSTALL` - Modify `install-python-packages` script to differentiate between input formats - Update test case to use `prometheus-client,pyjwt` as example dependencies - Improve flexibility for users specifying multiple Python packages via env var
20 lines
587 B
Bash
Executable File
20 lines
587 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -e
|
|
|
|
if [[ -n "$PYTHON_INSTALL" ]]; then
|
|
|
|
log-entrypoint 'Check status of PyPi.'
|
|
http_pypi_ok=$(curl -s --head --request GET https://pypi.org/simple/ | grep 'HTTP/2 200')
|
|
|
|
if [[ -n "$http_pypi_ok" ]]; then
|
|
# Handle both newline and comma-separated formats
|
|
if [[ "$PYTHON_INSTALL" == *","* ]]; then
|
|
# Comma-separated format
|
|
uv pip install $(echo "$PYTHON_INSTALL" | tr ',' ' ')
|
|
else
|
|
# Newline-separated or space-separated format
|
|
uv pip install $PYTHON_INSTALL
|
|
fi
|
|
fi
|
|
fi
|