[tools] Update install.sh for Flink Agents 0.3.0 and Python 3.12#888
[tools] Update install.sh for Flink Agents 0.3.0 and Python 3.12#888Olawoyin007 wants to merge 3 commits into
Conversation
Add 0.3.0 to the supported versions (new recommended default) and make the Python upper bound follow the selected release: 0.1.x/0.2.x keep >=3.10,<3.12, while 0.3.0+ accepts Python 3.12 per its requires-python metadata (>=3.10,<3.13).
|
The |
| py_minor="${py_version_output##*.}" | ||
|
|
||
| if [[ "$py_major" -ne 3 ]] || [[ "$py_minor" -lt 10 ]] || [[ "$py_minor" -ge 12 ]]; then | ||
| if [[ "$py_major" -ne 3 ]] || [[ "$py_minor" -lt 10 ]] || [[ "$py_minor" -ge "$(python_minor_ceiling)" ]]; then |
There was a problem hiding this comment.
This line is where the interpreter check starts depending on the selected release — and once resolve_python has run, the confirm screen can still change that release out from under it. edit_plan_interactive's flink_agents_version) arm reassigns FLINK_AGENTS_VERSION (install.sh:1112-1114 → 693) without re-checking the already-resolved PYTHON_BIN, unlike the enable_pyflink) arm right below it, which re-runs resolve_python when its dependent changes (install.sh:1153-1160). Concretely: a user on Python 3.12 accepts the new 0.3.0 default (validates here, ceiling 13), then at the confirm screen edits the version down to 0.2.1; setup_python_env then runs pip install flink-agents==0.2.1 (install.sh:1434), whose requires-python is <3.12, and the install fails after the plan looked good. Before this PR the interpreter was independent of the release, so this window didn't exist. Would re-validating PYTHON_BIN after a version edit — mirroring the enable_pyflink) arm — catch the mismatch at plan time rather than mid-install?
There was a problem hiding this comment.
Good catch - fixed in c4f81b4. The flink_agents_version) arm now calls a new revalidate_python_for_agents_version after the version prompt: if PyFlink is enabled and the already-resolved PYTHON_BIN no longer satisfies the new release's ceiling, it warns and re-runs resolve_python (same semantics as the enable_pyflink) arm - and since PYTHON_BIN is part of the edit-state dump, the re-resolved interpreter propagates back to the plan). Your exact scenario (3.12 accepted under 0.3.0, then edited down to 0.2.1) is covered by a new bats test, plus four more for the keep/no-op paths.
🤖 Generated with Claude Code
|
Minor test fixture drift: |
The Python ceiling now depends on the selected release, so editing the version at the confirm screen could invalidate an interpreter that resolve_python had already accepted, failing later in setup_python_env. Mirror the enable_pyflink edit arm: re-resolve at plan time.
reset_install_sh_state still carried the 0.2.1 version matrix, so sourced unit tests exercised different defaults than the installer ships. Align it with the 0.3.0 defaults.
|
Thanks - synced in ece24ba: 🤖 Generated with Claude Code |
Linked issue: #863
Purpose of change
install.shdid not offer the 0.3.0 release (shipped June 19th), and it rejected Python 3.12 even though 0.3.0 supports it.0.3.0toFLINK_AGENTS_SUPPORTED_VERSIONSand make it the recommended default, matching https://flink.apache.org/downloads/#apache-flink-agents (0.3.0 ships JARs for Flink 1.20 / 2.0 / 2.1 / 2.2, same matrix as 0.2.x).<3.12: 0.1.x/0.2.x keep>=3.10,<3.12, while 0.3.0+ accepts Python 3.12 (its wheels publishrequires-python >=3.10,<3.13). The version-mismatch messages now print the bound that actually applies.The version choice happens in stage 1 (
plan_flink_agents) before Python resolution in stage 2 (plan_pyflink), soFLINK_AGENTS_VERSIONis always settled whenvalidate_python_binruns.One known edge left as-is: on Python 3.12 with Flink 1.20/2.0,
apache-flinkhas no cp312 wheel on PyPI, so pip falls back to the sdist. That combination fails at pip time with a clear resolver message rather than being pre-blocked by the installer.Tests
tools/test/unit/validate_python_bin.batsto cover both bounds (3.12 rejected for 0.2.x, accepted for 0.3.0+, 3.13 still rejected) and updated the default-version assertion indry_run_extra.bats.bash tools/test/run.sh: all 149 tests pass.--flink-agents-version 0.2.1.API
No public API changes; installer script only.
Documentation
doc-neededdoc-not-needed(quickstart docs already state "Python 3.10, 3.11 or 3.12")doc-included🤖 Generated with Claude Code