← Back to Pull requests

[FLINK-39941][python] Pin virtualenv below 21.5 so py38 tox environments can still be created #58

Closed
unknown closed this pull request without merging on Sep 07, 2026 14:21 UTC
View on GitHub
unknown unknown commented on Sep 07, 2026 11:32 UTC
Author

What is the purpose of the change

The weekly CI of flink-connector-kafka fails on the v3.4 and v4.0 branches in the py38-cython tox environment since 2026-06-14, e.g. run 34002024546:

RuntimeError: the bundled seeder no longer ships pip/setuptools for Python 3.8; the oldest supported target is Python 3.9
ERROR:   py38-cython: InvocationError for command .../.uv/bin/python -m virtualenv --no-download --python .../envs/3.8/bin/python3.8 py38-cython

python/lint-python.sh installs tox==3.14.0 into the uv-created Python 3.11 base environment, and tox depends on virtualenv>=14 without an upper bound. virtualenv 21.5.0 (released 2026-06-13) dropped Python 3.8, so tox can no longer seed the py38 environment. PyFlink 1.20 and 2.0 still declare Requires-Python >=3.8, which is why those connector branches keep py38 in their envlist.

Brief change log

  • Add "virtualenv<21.5" to the tox install. It resolves to 21.4.3, which runs on the 3.11 base environment and creates 3.8 to 3.13 targets, so the py39 to py311 environments used on newer branches are unaffected.
  • Verifying this change

    The connector's flink-python/pom.xml downloads this script from the ci_utils branch at build time, so the fix is exercised by the next weekly run of flink-connector-kafka (python_test (1.20.5, v3.4) and python_test (2.0.2, v4.0)). Note that 21.4.3 seeds pip 25.0.1, the last pip release for Python 3.8, so this buys time; dropping py38 on those branches (apache/flink-connector-kafka#270) remains the end state.

    Was generative AI tooling used to co-author this PR?

  • [X] Yes (please specify the tool below)
  • Generated-by: Claude Code 2.1.263 (Claude Fable 5.1)

    Diff: 224 lines (+168 / -56) across 2 files Reviewer: autophagy Review duration: 169m
    All Vouch review confidence checks passed
    Residual risk 0.15 = Change Risk (0.37) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.37 · 224 lines diff across 2 files
    0.37
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.324
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #58"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 36.9% (MEDIUM) · Higher = larger blast radius
    36.9%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 14.6% · Safe to merge
    14.6%