Skip to content

Reject metadata directories that contain the project root - #323

Merged
gaborbernat merged 2 commits into
tox-dev:mainfrom
edsonsims:fix/ancestor-metadata-directory
Oct 18, 2026
Merged

gaborbernat merged 2 commits into
tox-dev:mainfrom
edsonsims:fix/ancestor-metadata-directory

Conversation

@edsonsims

Copy link
Copy Markdown
Contributor

Both wheel and editable metadata preparation clear their output directory before calling the backend. The existing validation rejects the project root itself but accepts an ancestor. A mistaken output path can therefore remove the source tree and sibling contents before the backend invocation fails.

Resolve both paths and reject an output directory that contains the project root before any cleanup. Preserve the existing same-root error and support for separate sibling output directories.

Regression tests exercise wheel/editable hooks with direct ancestor paths and symlink aliases, assert source and sibling sentinels remain unchanged, and retain sibling-output cleanup controls. All baseline cleanup tests use newly created temporary directories.

Validation on macOS, Python 3.13.1:

  • Original source with the new regression matrix: 4 failed, 2 passed; patched: all 6 pass.
  • Full suite: 102 tests pass. Ty and Ruff lint/format checks pass.
  • The repository's 100% aggregate coverage gate fails on the pristine base at 97.92% and on this change at 97.99%, with the same 18 missing statements in untouched _backend.py subprocess paths. The changed _frontend.py has 100% statement/branch coverage.
  • Other operating systems were not run locally; symlink tests follow the existing repository convention.

AI assistance: OpenAI Codex drafted the implementation and tests and performed automated review. The reported checks were run locally; owner manual review is not claimed.

@gaborbernat
gaborbernat enabled auto-merge (squash) October 18, 2026 06:55
@gaborbernat
gaborbernat merged commit a345a26 into tox-dev:main Oct 18, 2026
26 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