From 27457dc3ebbd434d6cffc6674008c7d90ee9d500 Mon Sep 17 00:00:00 2001 From: Jun Omae Date: Tue, 26 Sep 2023 11:12:50 +0900 Subject: [PATCH] Use python2.7 package instead of removed Python 2.7 binary of setup-python --- .github/posix-prepare.sh | 7 +++--- .github/posix-test-minimum.sh | 12 +++++++--- .github/posix-test.sh | 7 +++--- .github/release.sh | 12 +++++++--- .github/workflows/build.yml | 42 ++++++++--------------------------- 5 files changed, 33 insertions(+), 47 deletions(-) diff --git a/.github/posix-prepare.sh b/.github/posix-prepare.sh index 7758c243d4..7aa501a1a6 100755 --- a/.github/posix-prepare.sh +++ b/.github/posix-prepare.sh @@ -124,7 +124,8 @@ _EOS_ case "$MATRIX_OS" in ubuntu-*) sudo apt-get update -qq - sudo apt-get install -qq -y subversion + sudo apt-get install -qq -y python2.7 python2.7-dev python2-pip-whl \ + python2-setuptools-whl virtualenv subversion ;; macos-*) HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 @@ -135,9 +136,7 @@ case "$MATRIX_OS" in esac venvdir="$HOME/venv" -python -m ensurepip -python -m pip install virtualenv -python -m virtualenv "$venvdir" +virtualenv -p /usr/bin/python2.7 "$venvdir" python="$venvdir/bin/python" . "$venvdir/bin/activate" "$python" -m pip install --upgrade pip setuptools diff --git a/.github/posix-test-minimum.sh b/.github/posix-test-minimum.sh index 6c4a5d53dc..ac96fcafd3 100755 --- a/.github/posix-test-minimum.sh +++ b/.github/posix-test-minimum.sh @@ -2,10 +2,16 @@ set -ex +case "$MATRIX_OS" in + ubuntu-*) + sudo apt-get update -qq + sudo apt-get install -qq -y python2.7 python2.7-dev python2-pip-whl \ + python2-setuptools-whl virtualenv + ;; +esac + venvdir="$HOME/venv" -python -m ensurepip -python -m pip install virtualenv -python -m virtualenv "$venvdir" +virtualenv -p /usr/bin/python2.7 "$venvdir" . "$venvdir/bin/activate" python="$venvdir/bin/python" "$python" -m pip install --upgrade pip setuptools diff --git a/.github/posix-test.sh b/.github/posix-test.sh index 9acc441d93..e5c189a13e 100755 --- a/.github/posix-test.sh +++ b/.github/posix-test.sh @@ -115,7 +115,8 @@ run_tests() { case "$MATRIX_OS" in ubuntu-*) sudo apt-get update -qq - sudo apt-get install -qq -y subversion + sudo apt-get install -qq -y python2.7 python2.7-dev python2-pip-whl \ + python2-setuptools-whl virtualenv subversion ;; macos-*) HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 @@ -126,9 +127,7 @@ case "$MATRIX_OS" in esac venvdir="$HOME/venv" -python -m ensurepip -python -m pip install virtualenv -python -m virtualenv "$venvdir" +virtualenv -p /usr/bin/python2.7 "$venvdir" python="$venvdir/bin/python" . "$venvdir/bin/activate" "$python" -m pip install --upgrade pip setuptools diff --git a/.github/release.sh b/.github/release.sh index 20a4fbf979..ad035eca93 100755 --- a/.github/release.sh +++ b/.github/release.sh @@ -2,10 +2,16 @@ set -ex +case "$MATRIX_OS" in + ubuntu-*) + sudo apt-get update -qq + sudo apt-get install -qq -y python2.7 python2.7-dev python2-pip-whl \ + python2-setuptools-whl virtualenv + ;; +esac + venvdir="$HOME/venv" -python -m ensurepip -python -m pip install virtualenv -python -m virtualenv "$venvdir" +virtualenv -p /usr/bin/python2.7 "$venvdir" . "$venvdir/bin/activate" python -m pip install --upgrade pip setuptools pip install -r requirements-release.txt diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fbda4fd16a..096ac4b993 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,11 +25,12 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-22.04, macos-12] + os: [ubuntu-22.04] python-version: ['2.7'] tests: [functional] env: + MATRIX_OS: ${{ matrix.os }} MATRIX_TESTS: ${{ matrix.tests }} steps: @@ -37,11 +38,6 @@ jobs: - name: Checkout uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - name: Set up pip cache uses: actions/cache@v3 with: @@ -73,15 +69,10 @@ jobs: strategy: fail-fast: false matrix: - include: - - {os: ubuntu-22.04, python-version: '2.7', tracdb: '', tests: functional} - - {os: ubuntu-22.04, python-version: '2.7', tracdb: sqlite, tests: functional} - - {os: ubuntu-22.04, python-version: '2.7', tracdb: postgresql, tests: functional} - - {os: ubuntu-22.04, python-version: '2.7', tracdb: mysql, tests: functional} - - {os: macos-12, python-version: '2.7', tracdb: '', tests: functional} - - {os: macos-12, python-version: '2.7', tracdb: sqlite} - - {os: macos-12, python-version: '2.7', tracdb: postgresql} - - {os: macos-12, python-version: '2.7', tracdb: mysql} + os: [ubuntu-22.04] + python-version: ['2.7'] + tests: [functional] + tracdb: ['', sqlite, postgresql, mysql] env: MATRIX_OS: ${{ matrix.os }} @@ -95,11 +86,6 @@ jobs: - name: Checkout uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - name: Set up pip cache uses: actions/cache@v3 with: @@ -138,9 +124,8 @@ jobs: strategy: fail-fast: false matrix: - include: - - {os: ubuntu-22.04, python-version: '2.7'} - - {os: macos-12, python-version: '2.7'} + os: [ubuntu-22.04] + python-version: ['2.7'] env: MATRIX_OS: ${{ matrix.os }} @@ -159,11 +144,6 @@ jobs: ref: v1.4 path: py3c - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - name: Set up pip cache uses: actions/cache@v3 with: @@ -196,6 +176,7 @@ jobs: needs: [posix-test-minimum, posix-test] env: + MATRIX_OS: ${{ matrix.os }} PIP_NO_PYTHON_VERSION_WARNING: '1' PIP_DISABLE_PIP_VERSION_CHECK: '1' @@ -204,11 +185,6 @@ jobs: - name: Checkout uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - name: Set up pip cache uses: actions/cache@v3 with: