[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: New, updated pip coming



> On Jan 29, 2016, at 5:33 PM, Robert Collins <robertc@robertcollins.net> wrote:
> 
> I am confused. Here's my understanding of things...
> 
> - Pip doesn't need wheels at all - its vendoring technique doesn't use wheels.
> - Virtualenv needs to install pip, wheel, setuptools when it makes a
> new environment, and it does that by some oogly code
> - venv might do the same thing, but I haven't check its actual implementation
> - the pip-whl package was used to give virtualenv a thing to use to
> install pip when making a virtualenv
> 
> If that aligns with your understanding, I'll put it down to the prose
> you wrote rather than us actually having a different worldview; OTOH
> if it doesn't, I'd like to find out where I'm wrong, so as to improve
> my understanding.
> 
> With my understanding in mind - Can I just check something?
> 
> If a new requests package is built, uploaded to the archive and
> apt-get installed on my machine, and I then do:
> virtualenv test
> . test/bin/activate
> pip install foobar
> ^--- what version of requests will be used by this in-virtualenv
> invocation of pip?

Debian doesn’t want to utilize the bundled libraries in pip for various
reasons (some I agree with, some I don't, but suffice it to say it's a
requirement) but there is recognition that pip is a bit special here and can't
just be debundled in the standard way.

In conjunction with Barry, pip has some basic support for debundling by
deleting the contents of pip/_vendor/ except for pip/_vendor/__init__.py,
creating wheel files for all of pip's dependencies, and then making a small
patch to pip/_vendor/__init__.py to turn on the debundling feature and tell it
where those wheel files live. Pip will then add all of those wheel files to
the front of sys.path.

This gives us a few things:

* Pip will *always* use the versions of those libraries from the wheels,
  regardless of what is installed. This makes it so you can't break yourself
  with ``pip install requests`` in any environment (virtual or otherwise).

* Debian gets to have all of the code in pip come from the correct source
  packages.

These wheel files that represent pip's dependencies are generated when
python-pip is being built from the versions of the packages in Debian's
repositories and the python-pip package has a Built-Using header to indicate
which dependencies have been rebundled inside of pip through this process. This
has essentially recreated static linking but for Python. It is my understanding
that all of the wheels for pip's dependencies will exist inside of the
python-pip-whl .deb.

On top of that, virtualenv and venv will both need wheels that it needs to
install for pip, setuptools, and in the case of virtualenv, wheel. I'm not sure
what the plan is for those.

-----------------
Donald Stufft
PGP: 0x6E3CBCE93372DCFA // 7C6B 7C5D 5E2B 6356 A926 F04F 6E3C BCE9 3372 DCFA

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail


Reply to: