"""
Relenv site customize
"""
import os, pathlib, site, sys

# Remove any paths not relative to relenv's root directory.
path = []
root = pathlib.Path(__file__).parent.parent.parent.parent
for _ in sys.path:
    try:
        if pathlib.Path(_).relative_to(root):
            path.append(_)
    except ValueError:
        continue
sys.path = path
site.ENABLE_USER_SITE = False

try:
    import relenv.runtime
except ImportError:
    if "RELENV_DEBUG" in os.environ:
        print("Unable to find relenv.runtime for bootstrap.")
else:
    relenv.runtime.bootstrap()
