> On Dec 19, 2014, at 1:16 AM, Matthias Klose <d...@debian.org> wrote: > > On 12/19/2014 06:57 AM, Donald Stufft wrote: >> Ok, I hope I did this right. I made a sid system and updated/upgraded it >> then I >> did apt-get source python3.4 and used quilt to edit ensurepip-wheels.diff in >> order >> to fix pip inside of a virtual environment and then I added a new patch >> ensurepip-disabled.diff which I adapted from the one you have on Python 2.7 >> to >> disable ensurepip when running outside of a virtual environment. >> >> Output: https://bpaste.net/show/821a977c5f3c >> ensurepip-wheels.diff: https://bpaste.net/show/4e5852496eae >> ensurepip-disabled.diff: https://bpaste.net/show/5ed93f1df2fa >> >> I built the package, installed it and tested it (that’s what you see in the >> output >> link). > > this patch restores the behaviour to install the wheels twice, one time into a > temporary directory, and one time into a directory in the venv? why is this > double copy needed? If you require the wheels permanently in the virtual > environment, why would you need the copy in the tempdir? >
It doesn’t copy them twice, it copies the wheels named in /usr/share/python-wheels/%s.dependencies of which there is only currently the one file, pip.dependencies whose contents are: chardet colorama distlib html5lib requests setuptools six urllib3 Those are the dependencies that pip itself has, but importantly it’s not pip itself. Then it copies the projects named in the variable _PROJECTS, which is currently setuptools and pip, into a temporary directory. This isn’t strictly required for Debian I think, upstream ensurepip copies the bundled pip/setuptools wheels into a temporary directory because the stdlib might be zipped but I don’t think Debian ships a zipped stdlib. Anyways, once you have the pip and the setuptools wheels copied it then does the normal ensurepip logical which is basically ``pip install —no-index —find-links /tmp/dir/ pip setuptools`` to actually install pip and setuptools into the virtual environment. Essentially the first copy, into sys.prefix/lib/python-wheels is there to approximate the bundled dependencies that pip normally has (we don’t want to install these into the virtual environment because then ``pip uninstall requests`` inside of a virtual env would break pip without a good way to fix it which is one of the reasons pip bundles to begin with), and the second copy is just there to give pip a directory with a pip and setuptools wheels in it so it can install pip and setuptools into the virtual environment normally. Does that make sense? --- Donald Stufft PGP: 7C6B 7C5D 5E2B 6356 A926 F04F 6E3C BCE9 3372 DCFA -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org