Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Finding which packages support Python 3.x vs 2.7.x

Are there any methods for automatically finding which Python versions are supported by packages on PIP?

I am looking for something that generates a table like the one below obtained automatically from the PIP index. A manually mantained table from well-known GitHub repositories and contributors from the community would also be helpful:

           2.7.x   3.x
foo         ✓       ✗
bar         ✓       ✓
baz         ✗       ✓

Has anyone compiled a table like this before? Any thoughts on how I could automatically get this information?

like image 705
Josh Avatar asked Nov 19 '13 15:11

Josh


People also ask

What is the difference between Python 2.7 and Python 3?

Python 2.7 (last version in 2. x ) is no longer under development and in 2020 will be discontinued. Python 3 is a newer version of the Python programming language which was released in December 2008. This version was mainly released to fix problems that exist in Python 2.

What is the difference between Python 2 x and Python 3 x?

In python 2. x, “print” is treated as a statement and python 3. x explicitly treats “print” as a function. This means we need to pass the items inside your print to the function parentheses in the standard way otherwise you will get a syntax error.

How do I know if Python is 2 or 3?

If you want to determine whether Python2 or Python3 is running, you can check the major version with this sys. version_info. major . 2 means Python2, and 3 means Python3.

Is Python 2.7 still supported?

The Python Software Foundation declared Python 2 End of Life (EOL) on January 1, 2020, and ended support. Python 2.7. 18 was the final release of Python 2, released in April 2020.


1 Answers

Just use this: https://pypi.python.org/pypi/caniusepython3/

For the sake of statistics, this is openstack list of deps (161 in total): https://github.com/openstack/requirements/blob/master/global-requirements.txt

And this is what's holding them back:

  giampaolo@UX32VD:/tmp$ caniusepython3 -r requirements.txt 
  Finding and checking dependencies ...

  You need 67 projects to transition to Python 3.
  Of those 67 projects, 65 have no direct dependencies blocking their transition:

  boto
  cmd2
  coinor.pulp
  croniter
  ddt
  diskimage-builder
  django-bootstrap-form
  django-compressor
  django-openstack-auth
  dnspython
  eventlet
  extras
  gear
  hacking
  thrift (which is blocking happybase)
  jsonrpclib
  mysql-python
  netifaces
  nose-exclude
  nosehtmloutput
  nosexcover
  openstack-doc-tools
  openstack.nose-plugin
  os-apply-config
  os-collect-config
  os-refresh-config
  oslo.config
  oslo.messaging
  oslo.rootwrap
  oslo.sphinx
  oslosphinx
  pam
  ecdsa (which is blocking paramiko)
  paste
  posix-ipc
  proboscis
  pycadf
  pyghmi
  python-ceilometerclient
  python-cinderclient
  python-designateclient
  python-glanceclient
  python-heatclient
  python-ldap
  python-neutronclient
  python-openstackclient
  python-savannaclient
  python-seamicroclient
  python-swiftclient
  python-troveclient
  qpid-python
  rtslib-fb
  sockjs-tornado
  sphinxcontrib-docbookrestapi
  sphinxcontrib-httpdomain
  sphinxcontrib-pecanwsme
  sqlalchemy-migrate
  suds
  swift
  taskflow
  tripleo-image-elements
  warlock
  websockify
  xenapi
  zake
like image 169
Giampaolo Rodolà Avatar answered Sep 21 '22 17:09

Giampaolo Rodolà