diff --git a/rust/hgcli/pyoxidizer.bzl b/rust/hgcli/pyoxidizer.bzl --- a/rust/hgcli/pyoxidizer.bzl +++ b/rust/hgcli/pyoxidizer.bzl @@ -36,6 +36,12 @@ # Code to run in Python interpreter. RUN_CODE = """ +import os +import sys +extra_path = os.environ.get('PYTHONPATH') +if extra_path is not None: + # extensions and hooks expect a working python environment + sys.path[0:0] = extra_path.split(os.pathsep) import hgdemandimport; hgdemandimport.enable(); from mercurial import dispatch;