Add initial implementations for forms and organization apps with serializers, factories, and admin configurations
Some checks failed
CI/CD Pipeline / Run Tests (push) Failing after 45s
CI/CD Pipeline / Code Quality Checks (push) Failing after 48s
CI/CD Pipeline / Build Docker Images (push) Has been skipped
CI/CD Pipeline / Push to Gitea Registry (push) Has been skipped
CI/CD Pipeline / Deploy to Server (push) Has been skipped
Some checks failed
CI/CD Pipeline / Run Tests (push) Failing after 45s
CI/CD Pipeline / Code Quality Checks (push) Failing after 48s
CI/CD Pipeline / Build Docker Images (push) Has been skipped
CI/CD Pipeline / Push to Gitea Registry (push) Has been skipped
CI/CD Pipeline / Deploy to Server (push) Has been skipped
This commit is contained in:
34
scripts/ensure-ci-python.sh
Executable file
34
scripts/ensure-ci-python.sh
Executable file
@@ -0,0 +1,34 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
TARGET_VERSION="${1:-3.11}"
|
||||
IFS="." read -r PYTHON_MAJOR PYTHON_MINOR _ <<< "${TARGET_VERSION}"
|
||||
|
||||
if [[ -n "${PYTHON_MINOR:-}" ]]; then
|
||||
PYTHON_BIN="python${PYTHON_MAJOR}.${PYTHON_MINOR}"
|
||||
else
|
||||
PYTHON_BIN="python${PYTHON_MAJOR}"
|
||||
fi
|
||||
|
||||
if command -v "${PYTHON_BIN}" >/dev/null 2>&1; then
|
||||
command -v "${PYTHON_BIN}"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
APT_RUNNER=()
|
||||
if [[ "$(id -u)" -ne 0 ]]; then
|
||||
APT_RUNNER=(sudo)
|
||||
fi
|
||||
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
"${APT_RUNNER[@]}" apt-get update >&2
|
||||
if ! "${APT_RUNNER[@]}" apt-get install -y "${PYTHON_BIN}" "${PYTHON_BIN}-venv" >&2; then
|
||||
"${APT_RUNNER[@]}" apt-get install -y software-properties-common >&2
|
||||
"${APT_RUNNER[@]}" add-apt-repository -y ppa:deadsnakes/ppa >&2
|
||||
"${APT_RUNNER[@]}" apt-get update >&2
|
||||
"${APT_RUNNER[@]}" apt-get install -y "${PYTHON_BIN}" "${PYTHON_BIN}-venv" >&2
|
||||
fi
|
||||
|
||||
command -v "${PYTHON_BIN}"
|
||||
Reference in New Issue
Block a user