Bug 1327086 - Rebase on latest pip 8.x
Summary: Rebase on latest pip 8.x
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-pip
Version: 24
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Tomas Orsava
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1335134 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-04-14 09:19 UTC by Nick Coghlan
Modified: 2016-05-23 09:20 UTC (History)
7 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2016-05-23 09:20:23 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
An updated prefix stripping patch (4.47 KB, patch)
2016-05-17 15:14 UTC, Tomas Orsava
no flags Details | Diff
Patch to update the dist-git of python-pip to 8.1.2, including a new prefix-stripping patch (11.24 KB, patch)
2016-05-17 15:18 UTC, Tomas Orsava
no flags Details | Diff

Description Nick Coghlan 2016-04-14 09:19:24 UTC
I started doing a rebase of pip for F24 onto the upstream 8.1.1, and the file-prefix stripping patch failed to apply.

This turned out to be due to https://github.com/pypa/pip/pull/3448 which landed in pip 8.0.3: https://pip.pypa.io/en/stable/news/

(It's technically a bug fix, since the relative spec always said those paths should be relative)

That change means the paths in RECORD are now written relative to the site-packages directory by default, so the current patch stripping the prefix will confuse the generation of the relative path.

However, I'm not sure if just dropping the prefix stripping is right, either - it depends on what rewheel expects those paths to be relative to.

Either way, this should let us start down the path to dropping the patch entirely.

Comment 1 Nick Coghlan 2016-04-27 12:50:17 UTC
Slavek, how would I go about testing rewheel against a version of pip with this change? While F24 is in Beta Freeze now, it would be good to have the upgraded pip land promptly after the freeze is lifted.

Comment 2 Bohuslav "Slavek" Kabrda 2016-04-27 13:15:52 UTC
You just need to such version of pip installed systemwide. So either you create an updated local pip RPM or you update pip by pip from PyPI (I'm not 100 % sure, but I *think* this should work as well). I'd advise using mock chroot for testing this :)
If you need more specific info, let me know.

Comment 3 Nick Coghlan 2016-05-12 01:38:12 UTC
*** Bug 1335134 has been marked as a duplicate of this bug. ***

Comment 4 Nick Coghlan 2016-05-12 01:42:59 UTC
I changed the BZ title due to pip 8.1.2 just being released upstream.

Comment 5 Tomas Orsava 2016-05-17 15:14:19 UTC
Created attachment 1158365 [details]
An updated prefix stripping patch

Hi!
Here's my take on it: Upstream now correctly follows PEP 376 [0] by storing paths as relative to the `base location` (usually the `site-packages` directory) iff they are located somewhere under it. That means that we no longer need to strip the prefix of all these paths.

However, this does not affect paths that are not under the `base location`, such as `/usr/bin/`. Therefore this upstream change does not affect our need for the prefix stripping patch.

I have attached an updated prefix stripping patch that will work with the current version of pip (8.1.2) which clears the way for rebasing of the package.

[0] https://www.python.org/dev/peps/pep-0376/#record

Comment 6 Tomas Orsava 2016-05-17 15:18:47 UTC
Created attachment 1158366 [details]
Patch to update the dist-git of python-pip to 8.1.2, including a new prefix-stripping patch

Alternatively this is a patch for the entire dist-git to update pip to 8.1.2.

Included:

- Update to 8.1.2
- New PyPI URL format
- Updated prefix-stripping patch, which was also renamed so it no longer contains  "pip-1.5rc1" in its name

Comment 7 Tomas Orsava 2016-05-17 15:21:35 UTC
I should also clarify that prefix stripping for paths such as `/usr/bin/` is necessary because it is used while building the package to strip off the %{buildroot} so that only `/usr/bin` remains.

Comment 8 Tomas Orsava 2016-05-17 15:24:41 UTC
Lastly, if it would be preferable, I'm glad to do the update myself, but I'll have to ask for ACLs for the python-pip package.

Comment 9 Nick Coghlan 2016-05-20 04:40:43 UTC
Thanks Tomas, the update looks good to me (I was initially puzzled by the need to switch to files.pythonhosted.org to access the tarball, but I now suspect that's a consequence of the main service switching to Amazon S3 for artifact storage).

I think giving you access to push the update yourself would make sense, so I'll chat with bkabrda about that.

Comment 10 Nick Coghlan 2016-05-20 04:50:38 UTC
It occurs to me we might want to include a link to https://github.com/pypa/pip/issues/1351 somewhere to explain why we're carrying this patch: while upstream is amenable to a "--stage-dir" option (which we'd set to the RPM build root when invoking pip via macros), there's no actual implementation of that as yet.

In the meantime, the added "--strip-file-prefix" option handles the problem for Fedora (et al), even though upstream don't like that precise name for the option.

Comment 11 Nick Coghlan 2016-05-20 05:54:33 UTC
bkabrda is also OK with giving you access, so if you submit the ACL request, you'll be able to publish the update yourself.

Comment 12 Tomas Orsava 2016-05-20 09:23:09 UTC
You are right about the switch to the new URL format, here's further discussion if you are interested: https://bitbucket.org/pypa/pypi/issues/438/backwards-compatible-un-hashed-package

Good idea about the link, it took me a while to figure out what the patch was about since the comments were sparse, I'll include it right away. If they implement it upstream, we can drop our patch for good.

I just got the ACKs, so I'm going to push the update!

Comment 13 Tomas Orsava 2016-05-23 09:20:23 UTC
Forgot to close the bug since it's only going to rawhide and thus Bodhi won't do it.


Note You need to log in before you can comment on or make changes to this bug.