Differences between revisions 2 and 13 (spanning 11 versions)
Revision 2 as of 2014-02-03 21:27:55
Size: 1137
Editor: AugieFackler
Comment:
Revision 13 as of 2016-08-21 12:15:53
Size: 1653
Editor: PulkitGoyal
Comment:
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
This is a status page for keeping track of what needs to be done to make progress on Mercurial on Python 3. Nobody is actively working on this - AugieFackler works on it sporadically, and would be happy to see patches on this topic flagged with Py3 on the mailing list. The work in progress is visible at http://hg.durin42.com/hg-py3k/ - note that ChangesetEvolution is in use on that repository, and so hashes will change over time as the patchset is rebased. = Python 3 =
To see a summary of our current position on Python 3 support, see SupportedPythonVersions#Python_3.x_support.
Line 5: Line 6:
The most significant problem at the moment is some lingering cyclic imports in the codebase: This is a status page for keeping track of what needs to be done to make progress on Mercurial on Python 3.
Line 7: Line 8:
==== cmdutil -> subrepo -> cmdutil ==== GregorySzorc, AugieFackler, YuyaNishihara and PulkitGoyal are some of those who are responsible for the work done until now. PulkitGoyal was selected as GSoC student to do the porting work with MartijnPieters as his mentor.
Line 9: Line 10:
The easiest fix for this would be to move hgsubrepo to a new file, and then fix the registration mechanism to be dependency injected somehow. == What Works ==
run-tests.py can pass its own tests (test-run-tests.py and test-run-tests.t) under 2.6, 2.7 and 3.5.
Line 11: Line 13:
==== mercurial.repoview -> mercurial.revset -> mercurial.repoview ====


==== mercurial.fileset -> mercurial.merge -> mercurial.subrepo -> mercurial.match -> mercurial.fileset ====
If hgsubrepo moved out of subrepo, this would also be resolve.d


==== mercurial.filemerge -> mercurial.match -> mercurial.fileset -> mercurial.merge -> mercurial.filemerge ====
== Next Steps ==
 * Eliminate all Python 3 compatibility warnings from [[https://selenic.com/repo/hg/file/default/tests/test-check-py3-compat.t|test-check-py3-compat.t]]
 * Get the entire codebase working with 'from future import absolute_import' (Exceptions Left)
  * This requires fixing some cyclic imports. See [[https://selenic.com/repo/hg/file/default/tests/test-check-module-imports.t|test-check-module-imports.t]] for currently whitelisted cyclic imports. (./)
 * Make existing modules at least parse with Python 3 (still some Python 2.x syntax)
 * Remove 2to3 and have the source be 2.6/2.7/3.5 compatible (./)
 * Conditionalize imports for renamed modules (./)
 * Get the C extensions compiling correctly in Python 3
 * The codebase uses a source transformer which converts every string to bytes and few other hacks which are required to port. There are places where unicode is required in both Python 2 and 3, there are places where unicode is required in Python 3, and bytes in Python 2. So these things are to be fixed.

Note:

This page is primarily intended for developers of Mercurial.

Python 3

To see a summary of our current position on Python 3 support, see SupportedPythonVersions#Python_3.x_support.

This is a status page for keeping track of what needs to be done to make progress on Mercurial on Python 3.

GregorySzorc, AugieFackler, YuyaNishihara and PulkitGoyal are some of those who are responsible for the work done until now. PulkitGoyal was selected as GSoC student to do the porting work with MartijnPieters as his mentor.

1. What Works

run-tests.py can pass its own tests (test-run-tests.py and test-run-tests.t) under 2.6, 2.7 and 3.5.

2. Next Steps

  • Eliminate all Python 3 compatibility warnings from test-check-py3-compat.t

  • Get the entire codebase working with 'from future import absolute_import' (Exceptions Left)
  • Make existing modules at least parse with Python 3 (still some Python 2.x syntax)
  • Remove 2to3 and have the source be 2.6/2.7/3.5 compatible (./)

  • Conditionalize imports for renamed modules (./)

  • Get the C extensions compiling correctly in Python 3
  • The codebase uses a source transformer which converts every string to bytes and few other hacks which are required to port. There are places where unicode is required in both Python 2 and 3, there are places where unicode is required in Python 3, and bytes in Python 2. So these things are to be fixed.

Python3 (last edited 2023-02-19 16:08:38 by AntonShestakov)