Skip to content

Merge overlapping --target install directories - #14268

Open
sronix wants to merge 1 commit into
pypa:mainfrom
sronix:fix-8799-target-data-merge
Open

Merge overlapping --target install directories#14268
sronix wants to merge 1 commit into
pypa:mainfrom
sronix:fix-8799-target-data-merge

Conversation

@sronix

@sronix sronix commented Aug 21, 2026

Copy link
Copy Markdown

What does this PR do?

Fixes #8799.

pip install --target installs wheel contents into separate scheme
directories before moving them into the target. When package and .data
directories overlapped, target handling skipped or replaced one tree depending
on --upgrade.

Merge the scheme directories in a staging directory before applying existing
target replacement behavior. Duplicate files emit a warning, and the later
scheme entry takes precedence. File-directory conflicts fail before target
contents move.

Tests cover nested merges with and without --upgrade, duplicate files, both
file-directory conflict directions, and existing targets.

Tested with:

  • .venv/bin/pytest -q tests/functional/test_install.py -k target (15 passed)
  • .venv/bin/pre-commit run --all-files

PR Checklist:

  • I agree to follow the PSF Code of Conduct.
  • I have read and have followed the CONTRIBUTING.md file.
  • I have added a news file fragment (or this PR does not need one).
  • I have read and followed the AI_POLICY.md file, and if any AI tools were used, I have disclosed it below.

Assisted-by: Claude and Codex

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unexpected --target behavior with/without --upgrade

1 participant