From a5a32886b58e49a6fd60ddcf685eef5fbdfde491 Mon Sep 17 00:00:00 2001 From: Muhammad Yasirroni Date: Wed, 26 Jun 2024 06:06:34 +0700 Subject: [PATCH] get-pip if not installed --- .github/scripts/update_requirements.sh | 9 ++++++++- .github/workflows/update.yml | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/scripts/update_requirements.sh b/.github/scripts/update_requirements.sh index 58b0f3d..8c47817 100644 --- a/.github/scripts/update_requirements.sh +++ b/.github/scripts/update_requirements.sh @@ -16,7 +16,7 @@ install_python() { sudo apt install software-properties-common sudo add-apt-repository ppa:deadsnakes/ppa sudo apt-get update - sudo apt-get install -y python${version} + sudo apt-get install -y python${version} python${version}-venv else echo "Python ${version} is already installed." fi @@ -32,6 +32,13 @@ for version in "${PYTHON_VERSIONS[@]}"; do python${version} -m venv "env_${version}" source "env_${version}/bin/activate" + # Install pip using get-pip.py if it's not already installed + if ! command -v pip &> /dev/null; then + curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py + python get-pip.py + rm get-pip.py + fi + # Ensure pip is up-to-date within the virtual environment pip install --upgrade pip diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml index 6e433c0..82845d4 100644 --- a/.github/workflows/update.yml +++ b/.github/workflows/update.yml @@ -1,4 +1,4 @@ -name: Update Requirements +name: update on: pull_request: