A directory under both purelib and data is incorrectly removed by --target #7548
Labels
C: target
pip install's --target option's behaviour handling
resolution: duplicate
Duplicate of an existing issue/PR
state: awaiting PR
Feature discussed, PR is needed
type: bug
A confirmed bug or unintended behavior
Environment
Description
If a directory is duplicated between
purelib
anddata
,--target
blows it away in the middle of aninstall
, so it winds up containing only thedata
files.Expected behavior
The set of directories to be written should be computed only once and any removals should be done before creating any directories.
How to Reproduce
Given this reproducer as
reproducer.sh
:Run it as
sh reproducer.sh
inside an activated virtualenv.Output
Expect to see among the output:
That is, when
--prefix
was used it created a separateissue7548
directory inlib/python3.8/site-packages
and in the root directory, as expected, and thepurelib
one contains an__init__.py
and thedata
one containsdata.txt
, as expected.When
--target
was used onlydata.txt
exists, not__init__.py
, because in between installing thepurelib
files and installing thedata
files the_handle_target_dir
function removed theissue7548
directory.The text was updated successfully, but these errors were encountered: