Bug#912379: Bug #912379: /usr/bin/pip3: TypeError on "list --outdated": uses different Version implementations

2020-03-31 Thread Scott Kitterman
On Tue, 30 Oct 2018 21:50:36 +0100 Ben Wiederhake 
 wrote:
> Package: python3-pip
> Version: 9.0.1-2.3
> Severity: normal
> File: /usr/bin/pip3
> 
> Dear Maintainer,
> 
> I'm having trouble running this command:
> 
> pip3 list --outdated
> 
> Expected behavior: A list of outdated, local packages
> Actual behavior: TypeError
> 
> Full error message:
> 
> Traceback (most recent call last):
>   File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 215, in
> main
> status = self.run(options, args)
>   File "/usr/lib/python3/dist-packages/pip/commands/list.py", line 157, 
in
> run
> packages = self.get_outdated(packages, options)
>   File "/usr/lib/python3/dist-packages/pip/commands/list.py", line 168, 
in
> get_outdated
> dist for dist in self.iter_packages_latest_infos(packages, options)
>   File "/usr/lib/python3/dist-packages/pip/commands/list.py", line 169, 
in
> 
> if dist.latest_version > dist.parsed_version
> TypeError: '>' not supported between instances of 'Version' and 
'Version'
> 
> This is not Debian #878082.
> 
> Arch had a similar problem, there it was a packaging error:
> 
> https://github.com/pypa/pip/issues/5429
> 
> Could it be that the Debian package has a similar issue?

The problem turns out to be that setuptools and pip have different approaches 
for managing the namespace for packages they vendor and they are incompatible.  
Thanks to the incomparable dstufft for figuring it out.  The attached patch 
works around this incompatibility.  I've tested it with pip 20.2 on unstable 
and it resolves the issue.  This or something similar should work on earlier 
versions too.

Scott K--- a/src/pip/_internal/commands/list.py	2019-12-09 04:01:21.0 +
+++ b/src/pip/_internal/commands/list.py	2020-04-01 03:10:23.480796645 +
@@ -22,6 +22,8 @@
 )
 from pip._internal.utils.packaging import get_installer
 
+from pip._vendor.packaging.version import parse
+
 logger = logging.getLogger(__name__)
 
 
@@ -164,13 +166,13 @@
 def get_outdated(self, packages, options):
 return [
 dist for dist in self.iter_packages_latest_infos(packages, options)
-if dist.latest_version > dist.parsed_version
+if parse(str(dist.latest_version)) > parse(str(dist.parsed_version))
 ]
 
 def get_uptodate(self, packages, options):
 return [
 dist for dist in self.iter_packages_latest_infos(packages, options)
-if dist.latest_version == dist.parsed_version
+if parse(str(dist.latest_version)) == parse(str(dist.parsed_version))
 ]
 
 def get_not_required(self, packages, options):


signature.asc
Description: This is a digitally signed message part.


Bug#912379: /usr/bin/pip3: TypeError on "list --outdated": uses different Version implementations

2019-08-12 Thread Arnaldo Pirrone
Package: python3-pip
Version: 18.1-5
Followup-For: Bug #912379

Hi, the same is happening here:

Exception:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/pip/_internal/cli/base_command.py", line
143, in main
status = self.run(options, args)
  File "/usr/lib/python3/dist-packages/pip/_internal/commands/list.py", line
138, in run
packages = self.get_outdated(packages, options)
  File "/usr/lib/python3/dist-packages/pip/_internal/commands/list.py", line
149, in get_outdated
dist for dist in self.iter_packages_latest_infos(packages, options)
  File "/usr/lib/python3/dist-packages/pip/_internal/commands/list.py", line
150, in 
if dist.latest_version > dist.parsed_version
TypeError: '>' not supported between instances of 'Version' and 'Version'

according to https://github.com/pypa/pip/issues/5429
the bug is located downstream.



-- System Information:
Debian Release: bullseye/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.2.0-8.1-liquorix-amd64 (SMP w/4 CPU cores; PREEMPT)
Kernel taint flags: TAINT_OOT_MODULE
Locale: LANG=it_IT.UTF-8, LC_CTYPE=it_IT.UTF-8 (charmap=UTF-8), 
LANGUAGE=it_IT.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages python3-pip depends on:
ii  ca-certificates20190110
ii  python-pip-whl 18.1-5
ii  python33.7.3-1
ii  python3-distutils  3.7.4-3

Versions of packages python3-pip recommends:
ii  build-essential 12.6
ii  python3-dev 3.7.3-1
ii  python3-setuptools  41.0.1-1
ii  python3-wheel   0.32.3-2

python3-pip suggests no packages.

-- no debconf information



Bug#912379: /usr/bin/pip3: TypeError on "list --outdated": uses different Version implementations

2019-01-09 Thread BenWiederhake.GitHub

Control: found -1 18.1-4
Thanks

Hello,

still happens.

This is strictly necessary for the recommended "upgrade-all" method [1].
Pip currently has no other way to do this [2], and this feature is 
blocked by other issues [3], so "list --outdated" will continue to be of 
interest for a long time.


Cheers,
Ben

[1] https://stackoverflow.com/q/2720014/3070326
[2] https://github.com/pypa/pip/issues/4551
[3] https://github.com/pypa/pip/issues/988



Bug#912379: /usr/bin/pip3: TypeError on "list --outdated": uses different Version implementations

2018-10-30 Thread Ben Wiederhake
Package: python3-pip
Version: 9.0.1-2.3
Severity: normal
File: /usr/bin/pip3

Dear Maintainer,

I'm having trouble running this command:

pip3 list --outdated

Expected behavior: A list of outdated, local packages
Actual behavior: TypeError

Full error message:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 215, in
main
status = self.run(options, args)
  File "/usr/lib/python3/dist-packages/pip/commands/list.py", line 157, in
run
packages = self.get_outdated(packages, options)
  File "/usr/lib/python3/dist-packages/pip/commands/list.py", line 168, in
get_outdated
dist for dist in self.iter_packages_latest_infos(packages, options)
  File "/usr/lib/python3/dist-packages/pip/commands/list.py", line 169, in

if dist.latest_version > dist.parsed_version
TypeError: '>' not supported between instances of 'Version' and 'Version'

This is not Debian #878082.

Arch had a similar problem, there it was a packaging error:

https://github.com/pypa/pip/issues/5429

Could it be that the Debian package has a similar issue?

Cheers,
Ben



-- System Information:
Debian Release: buster/sid
  APT prefers testing-debug
  APT policy: (500, 'testing-debug'), (500, 'stable-updates'), (500, 
'stable-debug'), (500, 'testing'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.18.0-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=de_DE.utf8, LC_CTYPE=de_DE.utf8 (charmap=UTF-8), 
LANGUAGE=de_DE.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages python3-pip depends on:
ii  ca-certificates20170717
ii  python-pip-whl 9.0.1-2.3
ii  python33.6.6-1
ii  python3-distutils  3.6.6-1

Versions of packages python3-pip recommends:
ii  build-essential 12.5
ii  python3-dev 3.6.6-1
ii  python3-setuptools  40.2.0-1
ii  python3-wheel   0.30.0-0.2

python3-pip suggests no packages.

-- no debconf information