Python 2 / PyPy removal help page

Announcement: https://lists.debian.org/debian-python/2019/07/msg00080.html

Transition: https://release.debian.org/transitions/html/python2-rm.html

Fedora: https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3

Python 2 Countdown: https://pythonclock.org/

Common mistakes made when removing Python2 packages

Here are some issues seen for ongoing removal of Python2 packages:

Check list

Quick list of things to do while removing Python / ?PyPy binary package:

How to check for reverse dependencies

For a quick initial check / if you're looking for a package to work on, see http://sandrotosi.me/debian/py2removal/index.html: look for binary (not source) packages with 0 in the rdeps column.

To search for all runtime Depends/Recommends, and all mentions in the Sources index (Build-Depends*, Testsuite-Triggers, and the package itself):

Where $module is *binary* package name.

grep-dctrl -w -F Pre-Depends,Depends,Recommends -s Package "python-$module" 
/var/lib/apt/lists/*_debian_dists_{unstable,sid}_main_binary-amd64_Packages 
grep-dctrl -w -s Package "python-$module" 
/var/lib/apt/lists/*_debian_dists_{unstable,sid}_main_source_Sources

Outputs:

The alternative of "apt-cache rdepends python-$module ; reverse-depends -b python-$module" (ubuntu-dev-tools package) can be slow and does not find autopkgtest depends.

usertags (debian-python@lists.debian.org)

Every package should be tagged with:

Add more tags for better classifications:

FAQ

My package is affected only because it uses python-sphinx to generate documentation, what should I do?

just replace it with python3-sphinx, and in debian/rules, you can invoke Sphinx this way (the team do not recommand using the 'sphinx-build' command):

python3 -m sphinx

Discussions/Proposals

>  - bumping lintian info to warn, warn to error, ask ftp-master
>    to autoreject packages for some errors?