TEN-framework / TEN-framework/ten-framework

CI: Linux workflows run version scripts before installing Python deps (jinja2)

Open
#2,274 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
11.1k
Forks
1.4k
Avg merge
2d 15m
Merged PRs (30d)
22

Description

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 versionpython3 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 scriptpython .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

  • Add the missing pip3 install step(s) before Python scripts in the Linux/coverage jobs above
  • Re-run linux_ubuntu2204 / linux_arm64 (or the relevant matrix) and confirm Update version succeeds without ModuleNotFoundError: jinja2

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with .github/workflows/linux_ubuntu2204.yml, .github/workflows/linux_arm64.yml, and .github/workflows/coverage.yml, comparing their Python steps with the working macOS and Windows workflows. Ensure the dependency installation steps precede the named version and pytest setup scripts, then rerun the relevant Linux and coverage jobs and confirm the scripts complete without the jinja2 import error.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, python
Domain
ci-cd
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.