[python3 hgloader] .pyc pre-generation

Gregory Szorc gregory.szorc at gmail.com
Sun Aug 4 18:26:16 UTC 2019


For Python 3, there is no way to generate "proper" .pyc files since the
.pyc files we write aren't recognized as valid by a normal Python 3
interpreter without Mercurial's custom module importer. This is something
we'll likely address before Python 3 graduates from beta status.

If we can't remove the custom module importer before Python 3 support is
stable, we'll likely address the issue by having the installer write out
.pyc files containing the bytecode that Mercurial's module importer would
have produced and we'll have some way to short-circuit our custom module
importer so it doesn't attempt source transformation at import time.

On Sun, Aug 4, 2019 at 11:21 AM Blaise Thorn via Mercurial <
mercurial at mercurial-scm.org> wrote:

> How would I go about pre-generating /proper/ .pyc files for Mercurial?
>
> The installer (`python3 setup.py install` @ Makefile) produces pristine
> .pyc (kinda wasteful, since they will be overwritten anyway).
> I am no Python user; the naïve
>         python3 -c 'import mercurial; import compileall;
> compileall.compile_dir(".")'
> yielded the same pristine .pyc files; I presume, this way, hgloader is not
> activated?
>
> --
> βþ
> _______________________________________________
> Mercurial mailing list
> Mercurial at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20190804/58615dfd/attachment-0002.html>


More information about the Mercurial mailing list