From 50ca7c3dad28c16da3c725306c2d236fbca933cc Mon Sep 17 00:00:00 2001 From: Chris Down Date: Sat, 1 Jul 2023 10:14:44 +0800 Subject: [PATCH] ci: Fix Python 2.7 build --- .github/workflows/ci.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 281b0f6..7d9f038 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,9 +11,20 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 + # 2.7 not on setup-python: https://github.com/actions/setup-python/issues/672 + - if: matrix.py_version != '2.7' + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} + - name: Set up Python 2.7 + if: matrix.py_version == '2.7' + run: | + sudo apt-get update + sudo apt-get install -y python2.7 python2.7-dev python2-pip-whl + sudo ln -sf python2.7 /usr/bin/python + export PYTHONPATH=$(echo /usr/share/python-wheels/pip-*py2*.whl) + sudo --preserve-env=PYTHONPATH python -m pip install --upgrade pip setuptools wheel + sudo chown -R "$USER" /usr/local/lib/python2.7 - run: python --version - run: pip install -U pip