Note:

This page is primarily intended for developers of Mercurial.

Python 3

This is a status page for keeping track of what needs to be done to make progress on Mercurial on Python 3. Our current aim is to support Python 3.5+.

1. What Works

Most of the basic and daily usage commands work with out of tree extensions being disabled. More than 80% of test suite works with Python 3 and number of tests passing are increasing at a fast rate. The lists of passing tests can be found at python3-whitelist

It is very likely that an alpha or beta Python 3 release will be there in first half of 2019.

C extensions and out of tree hg-extensions still don't work.

2. Contributing

We will be happy to review patches and speed up the work related to Python 3. Before you start there are few things related to current porting and how things work currently. Most of our efforts are to make sure have Python 2 compatibility intact while making Python 3 run.

3. How to contribute

Pure-python tests are sometimes easier to port, but often need to be ported to use unittest first instead of our legacy testing system. The first step in migrating such tests to Python 3 involves porting to unittest, followed by any necessary followups to fix issues on Python 3. A list of tests that probably still need this work done can be obtained by running comm -23 <(hg files 'set:tests/test*py - grep(unittest)' | sed 's$tests/$$') contrib/python3-whitelist.

The practice we follow now is run commands which are not yet fixed and try to fix the exceptions raised. So our current approach is exception based.


CategoryAudit