Skip to content

fix(spec): handle dot-only version components - #147

Merged
gaborbernat merged 3 commits into
tox-dev:mainfrom
harbinresearcher:codex/handle-dot-only-version-specs
Oct 15, 2026
Merged

gaborbernat merged 3 commits into
tox-dev:mainfrom
harbinresearcher:codex/handle-dot-only-version-specs

Conversation

@harbinresearcher

Copy link
Copy Markdown
Contributor

Closes #146.

A dot-only version component produces an empty numeric tuple and raises IndexError. This also prevents discovery from trying a subsequent valid interpreter candidate.

Raise ValueError for the empty tuple so the existing parser fallback treats the input as a literal executable path, consistently with other malformed versions. Add parser cases and a real interpreter-discovery regression, document the fallback, and include a changelog fragment.

Validation:

  • Regression tests against pristine source: 7 failed, 1 passed; after the fix: 8 passed.
  • Linux official tox: Python 3.9–3.15 plus 3.15 free-threaded all passed with configured 100% coverage. Each environment adds seven passing cases.
  • Both configured type checks, Sphinx with warnings as errors, package build/metadata checks, and all pre-commit hooks passed.
  • Windows Python 3.12: 543 passed, 68 skipped, 33 failed. Pristine source has 536 passed, 68 skipped and the exact same 33 failing test IDs. These include symlink-privilege and other existing Windows fixture/assertion failures; the Windows full suite is not claimed to pass.

Tests ran against 469741a; rebased onto 1c9af8e, whose only intervening change updates release workflow action pins. Runtime and test files are unchanged by that upstream commit.

AI assistance was used for analysis, implementation, tests, and this description. Results were verified locally. Literal-path fallback does not guarantee that an arbitrary existing path is a usable interpreter.

@gaborbernat gaborbernat left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gaborbernat
gaborbernat enabled auto-merge (squash) October 15, 2026 07:10
@gaborbernat
gaborbernat merged commit ab2abc8 into tox-dev:main Oct 15, 2026
15 checks passed
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.

Dot-only version components raise IndexError during interpreter discovery

2 participants