Fixing issues with install's --target option. #2007
1. Check for the existence of a directory before copying from temporary directory to final target. If it exists, warn the user. 2. If the user specifies the --upgrade option and the directory exists, delete it and continue with installation. 3. Adding tests for above cases. This resolves pypa#1489, pypa#1710 completely and parts of pypa#1833.
If these can be fixed, that would be ideal. But they will be tricky to do so, and I'm not sure they are worth the bother.
@dstufft, @qwcode, @jezdez any opinions on this? I'm tempted to say that the behaviour with this patch is better than the current behaviour, so let's go with it. I'm also tempted to raise a follow-up PR to omit the metadata directories for a
Typical App Engine apps do not need the egg/dist-info files so maybe we can leave them out by default but with an option to include them? I just didn't want to add an option that only applied to
For your third point, I think I can safely cover that case. I'm still somewhat new to python packaging internals and I forgot that packages could be just one file.
@pfmoore that's fine with me. Will having the older info files around hurt pkg resources? If so, I would prefer to exclude them all together (which is pretty easy).
I've pushed a new commit to handle the case of single-module packages such as six. The reason I was skipping non-directories is because I didn't want to overwrite links. I've added a more appropriate check there and updated the tests to match.
Is there anything else that needs to be done on this?