Summary
Several Linux CI workflows run Python scripts that import third-party packages before any pip/pip3 install step in the same job. macOS/Windows workflows already install these packages first.
In particular, tools/version/update_version_in_ten_framework.py imports tools/version/common.py, which does from jinja2 import Template. On a clean runner this can fail with ModuleNotFoundError: No module named 'jinja2'.
Affected workflows (on main)
| Workflow |
Job |
Step that runs too early |
.github/workflows/linux_ubuntu2204.yml |
build |
Update version → python3 tools/version/update_version_in_ten_framework.py |
.github/workflows/linux_arm64.yml |
build |
same |
.github/workflows/linux_ubuntu2204.yml |
test-integration-* |
Install Python dependencies via script → python .github/tools/setup_pytest_dependencies.py (no prior workflow-level pip3 install, unlike mac/win) |
.github/workflows/coverage.yml |
test-integration-* |
same |
Current (linux_ubuntu2204.yml / build)
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Update version
run: |
python3 tools/version/update_version_in_ten_framework.py
python3 tools/version/check_version_in_ten_framework.py
Already correct pattern (mac_x64.yml / build)
- name: Install tools and dependencies
run: |
# ...
pip3 install --use-pep517 python-dotenv jinja2 requests
# ...
- name: Update version
run: |
python3 tools/version/update_version_in_ten_framework.py
python3 tools/version/check_version_in_ten_framework.py
Suggested fix
Align Linux (and the coverage integration jobs, for consistency) with the mac/win order: install at least jinja2 (and the other packages those jobs already use, e.g. python-dotenv, requests) via pip3 install before running the version / Python helper scripts.
Example for the Linux build jobs:
- name: Install Python dependencies
run: pip3 install --use-pep517 python-dotenv jinja2 requests
- name: Update version
run: |
python3 tools/version/update_version_in_ten_framework.py
python3 tools/version/check_version_in_ten_framework.py
Test plan
Summary
Several Linux CI workflows run Python scripts that import third-party packages before any
pip/pip3 installstep in the same job. macOS/Windows workflows already install these packages first.In particular,
tools/version/update_version_in_ten_framework.pyimportstools/version/common.py, which doesfrom jinja2 import Template. On a clean runner this can fail withModuleNotFoundError: No module named 'jinja2'.Affected workflows (on
main).github/workflows/linux_ubuntu2204.ymlbuildUpdate version→python3 tools/version/update_version_in_ten_framework.py.github/workflows/linux_arm64.ymlbuild.github/workflows/linux_ubuntu2204.ymltest-integration-*Install Python dependencies via script→python .github/tools/setup_pytest_dependencies.py(no prior workflow-levelpip3 install, unlike mac/win).github/workflows/coverage.ymltest-integration-*Current (
linux_ubuntu2204.yml/build)Already correct pattern (
mac_x64.yml/build)Suggested fix
Align Linux (and the coverage integration jobs, for consistency) with the mac/win order: install at least
jinja2(and the other packages those jobs already use, e.g.python-dotenv,requests) viapip3 installbefore running the version / Python helper scripts.Example for the Linux
buildjobs:Test plan
pip3 installstep(s) before Python scripts in the Linux/coveragejobs abovelinux_ubuntu2204/linux_arm64(or the relevant matrix) and confirmUpdate versionsucceeds withoutModuleNotFoundError: jinja2