Discussion here - #3 (comment)
add --egg option to opt out --single-version-externally-managed
add test for --egg option
This pull request fails (merged 66ff8e0 into e0db44e).
The Travis CI failure is an unrelated intermittent failing test, ignore that, tests pass on this.
Re making this option work via config or env var, good news -- you don't have to do anything, it already works. All pip options automatically work as either env vars (in this case, set PIP_EGG=1) or config file options (egg=1).
I do notice though that there's error output later in the install method because pip can't find where to put its installed-files record. I think we should still include the installed-files record and place it at the top-level inside the unzipped egg. This also means we should use the always-unzip flag when installing as an egg, which I think we should do anyway; I'm not aware of any good justification for installing zipped eggs.
Other than those fixes, this looks ready for merge! Good work, thanks!
I can't find a clean way to get the egg dir from list of files in record_filename. One I can think of right now:-
diff --git a/pip/req.py b/pip/req.py
index 0e50672..c86030e 100644
@@ -595,6 +595,9 @@ exec(compile(open(__file__).read().replace('\\r\\n', '\\n'), _
egg_info_dir = line
+ if line.endswith('EGG-INFO/PKG-INFO'):
+ egg_info_dir = line[:-len('EGG-INFO/PKG-INFO')]
logger.warn('Could not find .egg-info directory in install record
## FIXME: put the record somewhere
But since pip now can properly uninstall packages installed by easy_install, do we really need to keep installed-files.txt ? Packages installed with pip install --egg should be no different than the one installed by easy_install.
pip install --egg
I'm not totally opposed to just leaving out installed-files.txt, but I think it's better to have a full record of installed files than not, even though that makes the installation slightly different than what easy_install would do. Pip makes a best-effort to uninstall packages installed by easy_install, but without a proper uninstall log it depends on cobbling together various metadata to try to find installed scripts, data files, etc. A real installed-files log takes all the guessing out.
I think finding it should be just as easy as the current code to find the egg-info dir; directories are included too, so we can just look for a line.endswith('.egg') in addition to line.endswith('.egg-info'), right?
There's no .egg dir in record_filename. Here's list of files that I get when iterating record_filename while installing argparse module:-
Also I found out that there's no always--unzip option to setup.py install command:-
I've try the workaround setup.py easy_install -Z . as suggested in the thread. It work if I run it from command line but not through pip, it simply said no command easy_install.
setup.py easy_install -Z .
Meh, that's unfortunate that there's no --always-unzip for setup.py install. In that case, I think it's just not worth worrying about installed-files.txt. But I would like to get rid of that error, so can you add the appropriate checks so pip doesn't try to look for a place for installed-files.txt when --egg is used?
do write installed-files.txt if using install --egg
Sorry, the commit message a bit wrong. Should be "do not write installed-files.txt if using install --egg".
This pull request passes (merged becfb83 into e0db44e).