[PATCH 2 of 5] run-tests: add --with-python3 to define a Python 3 interpreter

Pierre-Yves David pierre-yves.david at ens-lyon.org
Mon Mar 14 09:48:35 EDT 2016



On 03/12/2016 10:11 PM, Gregory Szorc wrote:
> # HG changeset patch
> # User Gregory Szorc <gregory.szorc at gmail.com>
> # Date 1457818877 28800
> #      Sat Mar 12 13:41:17 2016 -0800
> # Node ID 8f46c2b82dee58117e861f1c374c8c229a8fd12d
> # Parent  afb4d2d519921346fd33b05880c677740ac8f086
> run-tests: add --with-python3 to define a Python 3 interpreter
>
> Currently, very few parts of Mercurial run under Python 3, notably the
> test harness.
>
> We want to write tests that run Python 3. For example, we want to
> extend test-check-py3-compat.t to parse and load Python files.
> However, we have a problem: finding appropriate files requires
> running `hg files` and this requires Python 2 until `hg` works
> with Python 3.
>
> As a temporary workaround, we add --with-python3 to the test harness
> to allow us to define the path to a Python 3 interpreter. This
> interpreter is made available to the test environment via $PYTHON3 so
> tests can run things with Python 3 while the test harness and `hg`
> invocations continue to run from Python 2. To round out the feature,
> a "py3exe" hghave check has been added.

Can we make it clear that this is temporary and why we need it in the 
code base itself? so that we can proceed to some cleanup in the future?

-- 
Pierre-Yves David


More information about the Mercurial-devel mailing list