because `path_to_url` is smarter than the ad-hoc code I hacked together.
In particular, it works on Windows, whereas my code didn't. This
prevents the following error on Windows:
Script result: svn import c:\users\admini~1\appdata\local\temp\pytest-27\test_freeze_svn0\workspace\scratch\version_pkg file://c:\users\admini~1\appdata\local\temp\pytest-27\test_freeze_svn0\workspace\scratch\pip-test-package-repo\trunk -m Initial import of pip-test-package
return code: 1
-- stderr: --------------------
svn: E170000: Illegal repository URL 'file://c:%5cusers%5cadmini~1%5cappdata%5clocal%5ctemp%5cpytest-27%5ctest_freeze_svn0%5cworkspace%5cscratch%5cpip-test-package-repo%5ctrunk'
This makes it easier to inspect with pdb.
Instead of:
(Pdb++) req_to_install
<pip.req.req_install.InstallRequirement object at 0x10459f7d0>
we get the much friendlier:
(Pdb++) req_to_install
<InstallRequirement object: wheel==0.24.0 in /Users/marca/python/virtualenvs/pip/lib/python2.7/site-packages>
This fixes 2 aspects of `pip install output`:
1. When `pip install` succeeds, it's still printing a lot of output from
the package's setup.py. The average consumer of Python packages, when
they do `pip install lxml`, probably doesn't care to see a bunch of
output about:
- copying files to a `build` directory
- installing and running Cython
- compiling C code
This is noise to most when the `pip install` succeeds. It's useful to
see all the output when the install fails, which is the subject of #2
below. On success, the output is now very clean with 5 short lines:
$ pip install lxml
Collecting lxml
Using cached lxml-3.4.2.tar.gz
Installing collected packages: lxml
Running setup.py install for lxml
Successfully installed lxml-3.4.2
2. When there's an error from `pip install`, it's annoying to have to
scroll through 2 different copies of the failure output (especially when
one is filtered and one is unfiltered so one might have stuff that the
other doesn't). This makes it not print the filtered version so that
there is just the unfiltered version and nothing is repeated.
$ pip install ~/dev/git-repos/lxml
Processing /Users/marca/dev/git-repos/lxml
Installing collected packages: lxml
Running setup.py install for lxml
Complete output from command ...
cc -c /var/folders/gw/w0clrs515zx9x_55zgtpv4mm0000gp/T/xmlCheckVersion4tBaVV.c -o var/folders/gw/w0clrs515zx9x_55zgtpv4mm0000gp/T/xmlCheckVersion4tBaVV.o
/var/folders/gw/w0clrs515zx9x_55zgtpv4mm0000gp/T/xmlCheckVersion4tBaVV.c:1:10: fatal error: 'libxml/xmlversion.h' file not found
#include "libxml/xmlversion.h"
^
1 error generated.
----------------------------------------
Command "/Users/marca/python/virtualenvs/pip/bin/python -c ...
None of the lines above are repeated.
Fixes a long-time annoyance that setup.py failure output has a blank
line after every line -- e.g.:
$ pip wheel ~/dev/git-repos/lxml
Processing /Users/marca/dev/git-repos/lxml
...
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/include/libxml2 -Isrc/lxml/includes -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.macosx-10.6-intel-2.7/src/lxml/lxml.etree.o -w -flat_namespace
In file included from src/lxml/lxml.etree.c:314:
src/lxml/includes/etree_defs.h:14:10: fatal error: 'libxml/xmlversion.h' file not found
#include "libxml/xmlversion.h"
^
1 error generated.
error: command '/usr/bin/clang' failed with exit status 1
...