The _extract_versions_from_specifier function stripped a single `~`
character from constraint strings, which corrupted PEP 440 compatible
release syntax (`~=`) by leaving a stray `=`. For example,
`thrift = "~=0.22.0"` produced the invalid constraint
`thrift>==0.22.0,<=0.23.0`, breaking every PR's "Unit Tests (min deps)"
job since #733 was merged.
Add an explicit branch for `~=` that strips both characters before
extracting the minimum version. The Poetry-style single `~` branch is
preserved for backward compatibility.
Co-authored-by: Isaac
Signed-off-by: Vikrant Puppala <vikrant.puppala@databricks.com>
Summary
Fixes a bug in scripts/dependency_manager.py where PEP 440 compatible release syntax (~=) was incorrectly handled, breaking every PR's "Unit Tests (min deps)" job.
What broke
PR #733 ("Bump thrift to fix deprecation warning") changed pyproject.toml:
scripts/dependency_manager.py::_extract_versions_from_specifier had a branch for Poetry-style ~ (single tilde) that strips one character. When applied to ~=0.22.0, it left =0.22.0 (with stray =). The downstream _create_flexible_minimum_constraint then produced the invalid constraint:
pip install rejects this with InvalidRequirement: Expected end or semicolon, failing every PR's min-deps install step.
Fix
Add an explicit branch for ~= that strips both characters before extracting the minimum version. The Poetry-style single ~ branch is preserved for backward compatibility.
How #733 got merged
PR #733 was merged with no CI checks reported on the branch — branch protection allowed the merge to bypass the unit test workflows that would have caught this. Worth investigating that separately.
Test plan
NO_CHANGELOG=true
This pull request was AI-assisted by Isaac.