python-apt offends python-pip's freeze

Bug #1489443 reported by Muelli
This bug report is a duplicate of:  Bug #1445949: Version does not conform to PEP440. Edit Remove
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-apt (Ubuntu)
New
Undecided
Unassigned
python-pip (Ubuntu)
New
Undecided
Unassigned

Bug Description

I'm trying to use pip freeze, but it fails:

>pip freeze
Exception:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main
    status = self.run(options, args)
  File "/usr/lib/python2.7/dist-packages/pip/commands/freeze.py", line 74, in run
    req = pip.FrozenRequirement.from_dist(dist, dependency_links, find_tags=find_tags)
  File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 299, in from_dist
    assert len(specs) == 1 and specs[0][0] == '==', (dist, req, specs, dependency_links)
AssertionError: (python-apt 0.9.3.11build1 (/usr/lib/python2.7/dist-packages), Requirement.parse('python-apt===0.9.3.11build1'), [('===', '0.9.3.11build1')], ['https://pypi.python.org/packages/source/c/certifi/certifi-1.0.1.tar.gz#md5=45f5cb94b8af9e1df0f9450a8f61b790', 'https://pypi.python.org/packages/source/w/wincertstore/wincertstore-0.2.zip#md5=ae728f2f007185648d0c7a8679b361e2'])

Note that I've patched /usr/lib/python2.7/dist-packages/pip/__init__.py to show me the dist.

It seems that pip does not like the string python-apt===0.9.3.11build1

This could be https://github.com/pypa/pip/issues/1093

ProblemType: Bug
DistroRelease: Ubuntu 15.04
Package: python-apt 0.9.3.11build1
ProcVersionSignature: Ubuntu 3.19.0-25.26-generic 3.19.8-ckt2
Uname: Linux 3.19.0-25-generic x86_64
ApportVersion: 2.17.2-0ubuntu1.2
Architecture: amd64
CurrentDesktop: GNOME
Date: Thu Aug 27 14:25:36 2015
SourcePackage: python-apt
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Muelli (ubuntu-bugs-auftrags-killer) wrote :
Revision history for this message
Muelli (ubuntu-bugs-auftrags-killer) wrote :

I think the duplicate status is wrong.

I did a sudo apt-get install -t wily python-apt to get 1.0.0~beta3.1ubuntu1 which is the version which is supposed to fix the problem.
However, pip freeze still fails.

$ pip freeze
Exception:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main
    status = self.run(options, args)
  File "/usr/lib/python2.7/dist-packages/pip/commands/freeze.py", line 74, in run
    req = pip.FrozenRequirement.from_dist(dist, dependency_links, find_tags=find_tags)
  File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 299, in from_dist
    assert len(specs) == 1 and specs[0][0] == '==', (dist, req, specs, dependency_links)
AssertionError: (python-apt 1.0.0.b3.1-ubuntu1 (/usr/lib/python2.7/dist-packages), Requirement.parse('python-apt===1.0.0.b3.1-ubuntu1'), [('===', '1.0.0.b3.1-ubuntu1')], ['https://pypi.python.org/packages/source/c/certifi/certifi-1.0.1.tar.gz#md5=45f5cb94b8af9e1df0f9450a8f61b790', 'https://pypi.python.org/packages/source/w/wincertstore/wincertstore-0.2.zip#md5=ae728f2f007185648d0c7a8679b361e2'])

Revision history for this message
Julian Andres Klode (juliank) wrote :

Nah, we just had a temporary hick up with the ~beta3.1 thing, which should have been ~beta4.

Revision history for this message
Julian Andres Klode (juliank) wrote :

Will be fixed again with the next upload.

Revision history for this message
Barry Warsaw (barry) wrote : Re: [Bug 1489443] Re: python-apt offends python-pip's freeze

On Aug 27, 2015, at 01:22 PM, Muelli wrote:

>I think the duplicate status is wrong.

I agree, but then it's not a bug in python-apt. It's really a bug caused by
our old version of pip, which doesn't natively understand PEP 440 'arbitrary
equality' clauses signified by the === marker. Even if you change
python-apt's version number it's still possible that some other installed
package will have a nonconforming version number.

Upgrading pip to the latest version is an arduous process because of all the
bureaucracy involved (and a bit of technical prerequisites), but in any case,
with the help of the upstream maintainer, I did backport a workaround in pip
1.5.6-7 (seen in Ubuntu as 1.5.6-7ubuntu1). You'll need wily though.

>I did a sudo apt-get install -t wily python-apt to get 1.0.0~beta3.1ubuntu1
>which is the version which is supposed to fix the problem. However, pip
>freeze still fails.

`pip list` would also trigger the bug, but it should be fixed now, at least in
unstable and wily. I have an ongoing task to update pip to the latest
upstream release.

Revision history for this message
Julian Andres Klode (juliank) wrote :

If you guys want this to track the pip bug, then please unduplicate it, and drop the python-apt bug.

Revision history for this message
Barry Warsaw (barry) wrote :

On Aug 27, 2015, at 02:16 PM, Julian Andres Klode wrote:

>If you guys want this to track the pip bug, then please unduplicate it,
>and drop the python-apt bug.

There's no need, it's already fixed.

Revision history for this message
Muelli (ubuntu-bugs-auftrags-killer) wrote :

On Thu, Aug 27, 2015 at 02:36:19PM -0000, Barry Warsaw wrote:
> There's no need, it's already fixed.
I confirm that the wily version makes pip freeze work.
Will we see a fix in vivid?

Revision history for this message
Barry Warsaw (barry) wrote :

On Aug 27, 2015, at 02:55 PM, Muelli wrote:

>I confirm that the wily version makes pip freeze work.

Yay!

>Will we see a fix in vivid?

Unlikely unless someone provides a patch. I probably won't have time, and
vivid is not an LTS.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.