msg230889 - (view) |
Author: Donald Stufft (dstufft) *  |
Date: 2014-11-09 16:58 |
As specified in PEP 477, this backports PEP 453 (ensurepip) to the Python 2.7 branch. Key differences from PEP 453 are: * It is not run by default in the Makefile * There is no venv modules, so downstream can remove it (though are asked to patch it to provide instructions redirecting people to how they should install pip). * The ``pip`` command is installed as well as ``pipX`` and ``pipX.Y``. * Given the above, --default-pip is hidden and no-oped and --no-default-pip is added to restore the Python 3.x behavior. This also includes a (slightly modified to make it work on 2.x) backport of unittest.mock as test._mock_backport in order to make it reasonable to run the ensurepip tests without actually installing pip. This patch does not include any changes to the Windows installers or to the OS X installers. I've nosey'd Ned Deily for the OS X installer changes, I'm not sure who is doing the Windows Installers now adays. Note: The attached patch does not contain the actual .whl files which are required. This is because it makes the patch into a 2M patch and the tracker didn't like that very much. This patch can be applied and then just copy over the Lib/ensurepip/_bundled directory from Python 3.4. |
|
|
msg230892 - (view) |
Author: Donald Stufft (dstufft) *  |
Date: 2014-11-09 17:17 |
Second patch just fixes the docs to specify the correct behavior for 2.7 and it fixes ensurepip.bootstrap() to match the default 2.7 behavior when executing python -m ensurepip. |
|
|
msg230907 - (view) |
Author: Matthias Klose (doko) *  |
Date: 2014-11-09 20:25 |
The mock backport doesn't come with a license. Please either include it in the file, or make it clear that the backport has the same license as python (?). |
|
|
msg230908 - (view) |
Author: Donald Stufft (dstufft) *  |
Date: 2014-11-09 20:25 |
The backport is taken from Python 3.4 so it's the same license as everything else. |
|
|
msg230909 - (view) |
Author: Donald Stufft (dstufft) *  |
Date: 2014-11-09 20:26 |
IOW it's literally Lib/unittest/mock.py from the 3.x series. |
|
|
msg230949 - (view) |
Author: Michael Foord (michael.foord) *  |
Date: 2014-11-10 09:51 |
mock in the Python standard library is licensed under the PSF license. |
|
|
msg231024 - (view) |
Author: Alyssa Coghlan (ncoghlan) *  |
Date: 2014-11-11 13:08 |
Thanks Donald, left some review comments on Reitveld. While I had some comments on the docs, I think the code changes all look fine - would it be worth incorporating this version immediately to make it easier to get started on the Windows and Mac OS X installer updates? |
|
|
msg231025 - (view) |
Author: Donald Stufft (dstufft) *  |
Date: 2014-11-11 13:24 |
I've updated the patch with Nick's comments, except for pulling in the latest versions of the documentation. |
|
|
msg231026 - (view) |
Author: Alyssa Coghlan (ncoghlan) *  |
Date: 2014-11-11 14:20 |
Thanks. I suggest committing that version, so the rest of the backport (installer integration & packaging docs backport) can proceed in parallel. |
|
|
msg231030 - (view) |
Author: Donald Stufft (dstufft) *  |
Date: 2014-11-11 16:10 |
Merged in https://hg.python.org/cpython/rev/592a5414fabd, I forgot to mention the issue number. I'm going to leave this open for the docs changes, however the OSX installer and Windows installer changes should be able to be made now. |
|
|
msg231077 - (view) |
Author: Alyssa Coghlan (ncoghlan) *  |
Date: 2014-11-12 13:49 |
The Windows installer integration backport is in issue 22850. Reviewing that made me release that the parallel version section in https://docs.python.org/3/installing/#work-with-multiple-versions-of-python-installed-in-parallel may need tweaking to account for the fact that the "py" launcher only comes with Python 3. That said, it's unlikely anyone will be wanting to switch between 2.6 and 2.7 on Windows at this point, so maybe we should just ignore it and wait and see if anyone complains. |
|
|
msg231096 - (view) |
Author: Alyssa Coghlan (ncoghlan) *  |
Date: 2014-11-13 01:54 |
Ned pointed out the wording regarding the Makefile changes in PEP 477 was ambiguous. My intent was for the changes to be backported, just with ENSUREPIP defaulting to "no" rather than "upgrade". So that part of the backport is still on the todo list (Ned's offered to handle that in addition to the Mac OS X installer changes) |
|
|
msg231201 - (view) |
Author: Ned Deily (ned.deily) *  |
Date: 2014-11-15 03:05 |
The OS X installer integration backport has been committed in Issue22877. |
|
|
msg231421 - (view) |
Author: Ned Deily (ned.deily) *  |
Date: 2014-11-20 10:32 |
The configure and Makefile integration backport has been committed in Issue22878. Unlike with Python 3, the default is to not install pip unless specifically enabled at configure time or on the "make altinstall" or "make install" targets. I think that about wraps up the code changes for PEP 477. But it looks like the documentation changes are not complete. I noticed the following warnings while building the docs: ./Doc/library/ensurepip.rst:31: WARNING: undefined label: installing-index (if the link has no caption the label must precede a section header) ./Doc/whatsnew/2.7.rst:2631: WARNING: undefined label: installing-index (if the link has no caption the label must precede a section header) ./Doc/whatsnew/2.7.rst:2631: WARNING: undefined label: distributing-index (if the link has no caption the label must precede a section header) It appears that part of the changes that reference the restructured "Installing Python Modules" and "Distributing Python Modules" docs (that replaced the original Distutils docs) got backported but not the docs themselves. Nick, were you planning to do that? If not, the references above should be fixed. |
|
|
msg231423 - (view) |
Author: Alyssa Coghlan (ncoghlan) *  |
Date: 2014-11-20 10:58 |
Yes, the missing link targets are part of the pending docs changes Donald mentioned above. |
|
|
msg231429 - (view) |
Author: Donald Stufft (dstufft) *  |
Date: 2014-11-20 13:33 |
I've attached a patch which I believe updates the 2.x docs with what 3.x has. I ran ``make html`` and the only errors I got were in relation to pyporting which I don't believe has anything to do with this ticket. If someone can sanity check this for me I can go ahead and merge this and close out this ticket. |
|
|
msg231431 - (view) |
Author: Donald Stufft (dstufft) *  |
Date: 2014-11-20 13:34 |
Note: I removed the references to pyvenv in these docs because 2.7 doesn't have that. |
|
|
msg231432 - (view) |
Author: Alyssa Coghlan (ncoghlan) *  |
Date: 2014-11-20 13:45 |
The "prior to version 3.4" question should be updated to talk about "prior to version 2.7.9" instead. For Python 2, we may want to explicitly mention installing virtualenv (either with pip or the system package manager), as there's no pyvenv provided by default, and the instructions do still assume the use of a virtual environment (just for permissions reasons, rather than the name of the Python executable). |
|
|
msg231433 - (view) |
Author: Donald Stufft (dstufft) *  |
Date: 2014-11-20 13:55 |
Updated the docs patch to address Nick's comments. |
|
|
msg231435 - (view) |
Author: Alyssa Coghlan (ncoghlan) *  |
Date: 2014-11-20 14:14 |
Looks good to me! :) |
|
|
msg231437 - (view) |
Author: Roundup Robot (python-dev)  |
Date: 2014-11-20 14:40 |
New changeset 8bc29f5ebeff by Donald Stufft in branch '2.7': Issue #22827: Backport the new Distributing and Instaling Docs from 3.4 https://hg.python.org/cpython/rev/8bc29f5ebeff |
|
|