Skip to content

Tests and the release generator need Python 3.11, and nothing states or checks it #1896

Closed

Description

@JacobStephens2

This was generated by AI during triage.

From the 2026-11-09 retro of thirdshift's own runs.

Agent Brief

Category: bug
Summary: Two Python scripts in the repository import tomllib, which needs Python 3.11. The documentation asks only for "Python 3", so on a host whose python3 is 3.9 the full Rust suite fails at one test, after running for 30 to 50 minutes.

Current behavior:

  • The Bug origin settlement helper imports tomllib. The test settlement::historical_review_and_reclosed_origin_regressions starts it with python3. The release generator imports tomllib too.
  • docs/testing.md says scripts/affected-tests "requires Python 3 and Git". No document names a minimum version, and nothing checks one.
  • On two hosts whose python3 is 3.9, the platform Python of Enterprise Linux 9, that test failed with ModuleNotFoundError: No module named 'tomllib' in 16 full-suite runs across 15 issues between 2026-10-29 and 11-09. The failure shows only when the suite ends.
  • Sessions then find python3.11 or python3.12 and run the suite again, often through a PATH shim. 36 sessions on those two hosts called one of them.

Desired behavior:

  • The repository states one minimum Python version, 3.11, where it documents test prerequisites.
  • scripts/affected-tests checks that version before it selects or runs anything. Below the minimum it exits non-zero at once with one line giving the version found, the version needed and the interpreter's path.
  • A Python script that the Rust tests start, run on an older interpreter, fails with the same one-line message in place of an import traceback. The release generator does the same.

Key interfaces:

  • scripts/affected-tests: a version check ahead of its selection. The script must still parse on the older interpreter far enough to print the message.
  • The Python helpers the Rust tests start, and the release generator: the same check, shared if sharing stays simple.
  • The selector's unit tests: cases for interpreters below and at the minimum.

Acceptance criteria:

  • A unit test shows the check rejecting 3.9 and 3.10 and accepting 3.11, and the rejection names both the version found and the version needed.
  • On a rejected interpreter the selector runs no check and exits non-zero.
  • With Python 3.11 or later, the selector's selection and output are unchanged.
  • docs/testing.md names the minimum version.
  • python3 -m unittest discover -s scripts -p 'test_*.py' passes.

Out of scope:

  • Making the scripts run on Python older than 3.11.
  • Installing or selecting a Python on any host. Each host provides a python3 that meets the minimum.
  • Pinning the Python version CI uses.

Activity

  1. added
    bug
    ready-for-agent
    in-progress
    and removed
    ready-for-agent
    on Nov 9, 2026
  2. removed
    in-progress
    on Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions