From 4e132607c32f8b26f6aa9af2465ca197f3b7c78b Mon Sep 17 00:00:00 2001 From: Milan Kolar Date: Mon, 18 Jan 2021 12:20:03 +0100 Subject: [PATCH] suggestions for environment handling --- start.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/start.py b/start.py index 9c648e931c..d9b825307b 100644 --- a/start.py +++ b/start.py @@ -424,14 +424,24 @@ def boot(): paths += repos os.environ["PYTHONPATH"] = os.pathsep.join(paths) + # TODO: add venv when running from source + # set this to point either to `python` from venv in case of live code # or to `pype` or `pype_console` in case of frozen code os.environ["PYPE_EXECUTABLE"] = sys.executable - # DEPRECATED: remove when `pype-config` dissolves into Pype for good. + # TODO: DEPRECATE remove when `pype-config` dissolves into Pype for good. + # PYPE_MODULE_ROOT should be changed to PYPE_REPOS_ROOT + # This needs to replace environment building in hosts # .-=-----------------------=-=. ^ .=-=--------------------------=-. os.environ["PYPE_MODULE_ROOT"] = os.environ["PYPE_ROOT"] + # TODO: add pype tools and vendor to environment + os.environ["PYTHONPATH"] = os.pathsep.join( + [os.environ["PYTHONPATH"], + os.path.join(os.environ["PYPE_ROOT"], "pype", "tools"), + os.path.join(os.environ["PYPE_ROOT"], "pype", "vendor")]) + # delete Pype module from cache so it is used from specific version try: del sys.modules["pype"]