fix(env): parso-version-aware interpreter selection for the analysis venv - #108
Merged
Merged
Conversation
…venv (#107) jedi parses the analysis environment's Python with parso, which ships one hardcoded grammar per minor version. On hosts whose default python3 is newer than the newest shipped grammar (e.g. 3.14 with parso <= 0.8.4), every file failed with 'Python version 3.14 is currently not supported' and the run still exited 0 with an empty symbol table. Provisioning now derives parso's ceiling at runtime from its shipped grammar files and swaps a too-new default for the newest supported interpreter on the host (versioned PATH names, then pyenv installs), falling back loudly only when none exists. An explicit SYSTEM_PYTHON is honored with a warning when unsupported. A run in which every discovered file fails now logs a prominent error instead of staying silent, and parso>=0.8.5 (first release with the 3.14 grammar) is a direct dependency.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #107.
jedi parses the analysis environment's Python version with parso, which ships one hardcoded grammar file per minor version. On hosts whose default
python3is newer than the newest shipped grammar (e.g. Python 3.14 with parso ≤ 0.8.4), every file failed with "Python version 3.14 is currently not supported" — and the run still completed "successfully" with an empty symbol table and exit 0.Fix (three layers):
_get_base_interpreternow derives parso's supported ceiling at runtime from its shippedgrammar*.txtfiles (never hardcoded — the ceiling moves automatically when parso adds 3.15) and swaps a too-new default for the newest supported interpreter on the host (versioned PATH names first, then pyenv installs, skipping the analyzer's own venv). It falls back to the default loudly only when nothing supported exists. An explicitSYSTEM_PYTHONis still honored, with a warning when parso can't parse its version.parso>=0.8.5(the first release shipping the 3.14 grammar) is now a direct dependency, so fresh installs parse 3.14 environments regardless.Tests: 8 new regression tests in
test/test_env_interpreter.pycovering ceiling derivation from grammar stems, supported-interpreter picking, the swap/keep/fallback paths of_get_base_interpreter, and the loud-empty-symbol-table guard.Local gate: 185 passed, 5 skipped, plus 1 failure in
test_cli_call_symbol_table_with_json(--ray) that is machine-environmental, not from this diff: it fails identically on a clean checkout without this change, and a 4-line pure-Ray script (no codeanalyzer code) also fails to spawn workers on this host (worker_pool.cc: workers have not registered within the timeout). The release workflow's Linux CI run is the enforcing gate (tag is deleted on test failure).