From 449756025ae0216d48878c10ab30d7b3e0737e94 Mon Sep 17 00:00:00 2001 From: jenna-tomkinson Date: Wed, 2 Dec 2026 09:47:45 -0700 Subject: [PATCH] Fix CI: run EOL-Python CI jobs in Docker instead of via actions/setup-python The compat and install-from-github jobs' Python 3.8 entries started failing with "The version '3.8' with architecture 'x64' was not found for Ubuntu 26.04" once ubuntu-latest moved to 26.04 -- GitHub's hosted Python builds for EOL versions (3.8 EOL'd Oct 2024) aren't published for new runner OS images, so this will keep breaking on every future ubuntu-latest bump. Switch those jobs to run inside the official `python:X.Y` Docker image instead of using actions/setup-python: Docker Hub keeps every python:X.Y tag published indefinitely, independent of the runner's own OS, so this doesn't have the same expiry problem. Verified locally (not just in theory): ran the exact install command each CI job runs -- `pip install git+https://github.com/WayScience/CP_Parallel.git@` and `pip install .` from a clean checkout -- inside `python:3.8` and `python:3.9` containers. Both succeed and `cp_parallel.run_parallel` imports correctly; the package itself was never broken, only the CI runner's ability to provision Python 3.8/3.9 via actions/setup-python. Co-Authored-By: Claude Sonnet 5 --- .github/workflows/test.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1bf4c7a..2975236 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -47,7 +47,14 @@ jobs: # Smoke-tests that the published package itself -- no dev tooling -- still # installs and imports on the older Python versions that real CellProfiler # conda environments commonly run (e.g. CellProfiler 4.x on Python 3.8). + # Runs inside the official `python` Docker image rather than using + # actions/setup-python: GitHub's hosted Python builds for EOL versions like + # 3.8/3.9 aren't published for new runner OS images (there's no 3.8 or 3.9 + # build for ubuntu-26.04, for example), so setup-python breaks every time + # the ubuntu-latest image moves forward. Docker Hub keeps every + # `python:X.Y` image published indefinitely, independent of the runner OS. runs-on: ubuntu-latest + container: python:${{ matrix.python-version }} strategy: matrix: python-version: ["3.8", "3.9"] @@ -55,9 +62,6 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 # full history + tags, so setuptools-scm sees the real version - - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - name: Install the package (no dev dependencies) run: pip install . - name: Import sanity check @@ -69,16 +73,17 @@ jobs: # it catches anything missing from the built package (e.g. files only present # in the repo tree). Pinned to the commit under test: for a PR, that's the # PR's head commit, which GitHub exposes on the base repo even for forks. + # Runs inside the official `python` Docker image for the same reason as + # `compat` above -- actions/setup-python can't provide Python 3.8 on + # current runner images. runs-on: ubuntu-latest + container: python:${{ matrix.python-version }} strategy: matrix: python-version: ["3.8", "3.12"] env: INSTALL_URL: git+https://github.com/${{ github.repository }}.git@${{ github.event.pull_request.head.sha || github.sha }} steps: - - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - name: Install from GitHub URL run: pip install "$INSTALL_URL" - name: Import sanity check (outside any source tree)