Skip to content

ci: upgrade Python 3.8 → 3.11 in tool_list_conversion workflow - #390

Merged
bedroesb merged 2 commits into
mainfrom
copilot/update-python-version-3-11
May 26, 2026
Merged

ci: upgrade Python 3.8 → 3.11 in tool_list_conversion workflow#390
bedroesb merged 2 commits into
mainfrom
copilot/update-python-version-3-11

Conversation

Copilot AI commented May 26, 2026

Copy link
Copy Markdown
Contributor

python-frontmatter now imports TypeGuard from typing, which requires Python 3.10+. This breaks both validation and registry-lookup jobs running on Python 3.8 with an ImportError.

Changes

  • .github/workflows/tool_list_conversion.yml: bump python-version from 3.8 to 3.11 in both jobs
Original prompt

Fix the failing GitHub Actions job in repository elixir-europe/infectious-diseases-toolkit.

Context:

  • Failing job URL: https://github.com/elixir-europe/infectious-diseases-toolkit/actions/runs/26404324139/job/77723909713
  • Workflow file: .github/workflows/tool_list_conversion.yml
  • The workflow currently uses Python 3.8 in both the validation and registry-lookup jobs.
  • The install step installs ruamel.yaml requests python-frontmatter.
  • The job log shows this import error:
    • ImportError: cannot import name 'TypeGuard' from 'typing' (/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/typing.py)
  • This indicates an incompatibility between Python 3.8 and the currently resolved python-frontmatter dependency.

Requested fix:

  • Update the workflow so the job no longer fails due to this dependency/runtime mismatch.
  • Preferred approach: upgrade the workflow Python version from 3.8 to a compatible currently supported version such as 3.11 in both jobs.
  • Keep the change minimal and focused on fixing the workflow failure.

Acceptance criteria:

  • The workflow .github/workflows/tool_list_conversion.yml is updated so both jobs use a compatible Python version.
  • No unrelated files are modified.
  • Open a pull request with a concise title and summary explaining the compatibility fix.

The following is the prior conversation context from the user's chat exploration (may be truncated):

User: Please find a solution for this failing job. Use the logs, job definition, and any referenced files where the failure occurred. Keep your response focused on the solution and include code suggestions when appropriate.

Assistant: The failure is caused by an incompatible Python/package combination in the workflow, not by the validator script itself.

Root cause

The job runs on Python 3.8:

  • .github/workflows/tool_list_conversion.yml lines 13–14
  • .github/workflows/tool_list_conversion.yml lines 36–38

and installs python-frontmatter without pinning a compatible version:

  • .github/workflows/tool_list_conversion.yml lines 22–25
  • .github/workflows/tool_list_conversion.yml lines 49–52

The log shows:

  • ImportError: cannot import name 'TypeGuard' from 'typing'

This happens because the installed python-frontmatter dependency now imports TypeGuard from typing, which requires a newer Python version than 3.8.

Solution

Use one of these fixes:

Preferred fix: upgrade the workflow to Python 3.10+

Update both job matrices from 3.8 to 3.10 or 3.11.

strategy:
  matrix:
    python-version: [3.11]

Apply that change in:

A minimal patch would be:

jobs:
  validation:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        python-version: [3.11]

and

  registry-lookup:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        python-version: [3.11]

Alternative fix: pin python-frontmatter to a Python-3.8-compatible version

If you must stay on Python 3.8, pin the package in the install step instead of installing the latest release.

Example:

pip install ruamel.yaml requests "python-frontmatter<1.1"

This is less future-proof than upgrading Python, because Python 3.8 is already old and more dependencies may start breaking similarly.

Recommended final change

Update the workflow file at:

Change:

python-version: [3.8]

to:

python-version: [3.11]

in both jobs.

If you want to make the install step more reproducible as well, use:

- name: Install dependencies
  run: |
    python -m pip install --upgrade pip
    pip install ruamel.yaml requests python-frontmatter

with Python 3.11, or pin all dependency versions explicitly.

User: you can make a PR fixing this

Assistant: I’ve prepared the PR fix and am currently waiting for your confirmation on the repo action before I can continue.

This pull request was created from Copilot chat.

@bedroesb
bedroesb marked this pull request as ready for review May 26, 2026 07:25
@bedroesb
bedroesb self-requested a review as a code owner May 26, 2026 07:25
Copilot AI changed the title [WIP] Update Python version to 3.11 in workflow for job compatibility ci: upgrade Python 3.8 → 3.11 in tool_list_conversion workflow May 26, 2026
@bedroesb
bedroesb merged commit 83b7f54 into main May 26, 2026
4 checks passed
@bedroesb
bedroesb deleted the copilot/update-python-version-3-11 branch May 26, 2026 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants