sapling/hgdemandimport
Kostia Balytskyi 50ddbd96dd hg.rust: add py logic to support running from a zipped stdlib
Summary:
This is needed for the `py2exe`-like loading of the the python stdlib and mercurial files.
The `zipimport` per se works out of the box in Python. The problem is loading native extensions.
Since some of them are parts of packages, such as `mercurial.cext.osutil`, and `mercurial/cext/`
folder structure does not exist in the embedded case, we're just doing what `py2exe` does: renaming
every native extension file to include the full package path, e.g. `mercurial.cext.osutil.pyd` and
tweaking the loader to know to try such files.

NB: I want to rename `hgdemandimport` to `hgimport` later, since now there are more responsibilities
for this package. We can probably also just merge it with `mercurial`, since we don't care about
`python3`

Reviewed By: quark-zju

Differential Revision: D9919806

fbshipit-source-id: 216ae904760311003e7171cb6fbe0bbc4b1abe2b
2018-10-12 14:55:09 -07:00
..
__init__.py hg.rust: add py logic to support running from a zipped stdlib 2018-10-12 14:55:09 -07:00
demandimportpy2.py codemod: join the auto-formatter party 2018-05-25 22:17:29 -07:00
demandimportpy3.py codemod: join the auto-formatter party 2018-05-25 22:17:29 -07:00
embeddedimport.py hg.rust: add py logic to support running from a zipped stdlib 2018-10-12 14:55:09 -07:00