Skip to content

fix(env): parso-version-aware interpreter selection for the analysis venv - #108

Merged
rahlk merged 1 commit into
mainfrom
fix/issue-107-env-interpreter-selection
Jul 21, 2026
Merged

fix(env): parso-version-aware interpreter selection for the analysis venv#108
rahlk merged 1 commit into
mainfrom
fix/issue-107-env-interpreter-selection

Conversation

@rahlk

@rahlk rahlk commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

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 python3 is 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_interpreter now derives parso's supported ceiling at runtime from its shipped grammar*.txt files (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 explicit SYSTEM_PYTHON is still honored, with a warning when parso can't parse its version.
  • A run in which every discovered file fails now logs a prominent error naming the likely cause instead of staying silent.
  • 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.py covering 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).

…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.
@rahlk
rahlk merged commit ab1acbc into main Jul 21, 2026
@rahlk
rahlk deleted the fix/issue-107-env-interpreter-selection branch July 21, 2026 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Env provisioning picks the system default interpreter — on Python 3.14 hosts every file fails jedi/parso and analysis returns silently empty

1 participant