Skip to content

fix: honor PEP 514 executable arguments during discovery - #148

Merged
gaborbernat merged 4 commits into
tox-dev:mainfrom
blouirts123:fix/pep514-executable-arguments
Oct 16, 2026
Merged

gaborbernat merged 4 commits into
tox-dev:mainfrom
blouirts123:fix/pep514-executable-arguments

Conversation

@blouirts123

@blouirts123 blouirts123 commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

PEP 514 ExecutableArguments are read from the registry but discarded before interpreter interrogation. A registration pointing to py.exe with -3.11 is consequently queried as the launcher's default runtime and can be omitted from Python 3.11 discovery.

Carry the raw Windows argument fragment before the quoted collector arguments without invoking a shell. Include arguments in memory/disk cache identity, normalize blank values, and retain the collected child executable for argument-bearing launcher queries so the returned path launches the selected runtime. The ordinary public no-argument API is unchanged. Add registry, quoting, cache and real-launcher regressions.

Validation on Windows: 51 focused tests passed, 8 skipped, one known baseline fixture failure deselected; the real py.exe -3.11 test passed independently and executed the returned Python binary. Ruff, formatting, docs and package-metadata checks pass. A full same-base comparison produced the identical 34 failing test IDs on both trees, with eight additional passes in the candidate. Both configured type targets likewise match the clean base's 13 existing diagnostics, with no candidate-only findings. Those unrelated baseline failures remain unchanged.

The argument ordering follows PEP 514.

Hosted runtime suites passed (611–613 tests each) but exposed missing coverage for the new argument-query branches on Linux. Added five cross-platform contract tests for cache identity/fallback, non-Windows rejection, selected executable preservation, and raw Popen command construction. The local focused module passes 29 tests with 8 Windows-inapplicable skips; independent review and Ruff pass. The new hosted run is pending.

blouirts123 and others added 4 commits October 16, 2026 05:21
Pass ExecutableArguments through the existing query path instead of a
parallel one: one Popen call that takes a raw command line when arguments
are present, and the arguments stored in the disk cache entry metadata
rather than a separate DiskCache store reached through getattr. The
metadata key is always written, so a plain query of a launcher no longer
reads an entry written for the same launcher with arguments, which the
previous optional key allowed for caches without the private method.

Drop the unreachable non-Windows guard and the registry helper that
returned a validity flag, and move the argument tests to their own file.

@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 16, 2026 01:10
@gaborbernat
gaborbernat merged commit cbb2abd into tox-dev:main Oct 16, 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.

2 participants