Commit 80495793 authored by eric pellegrini's avatar eric pellegrini

Modified the site.py for having a bundle sys.path free of any System python

parent d235df43
Pipeline #4238 passed with stages
in 24 minutes and 44 seconds
......@@ -87,7 +87,6 @@ ln -s ../Resources/bin/python ${MDANSE_APP_DIR}/Contents/MacOS/python
## In order that the modified python in the bundle import the zipped sitepackages located in Contents/Resources we provide a modified site.py that will
## update the sys.path accordingly
cp ${CI_PROJECT_DIR}/BuildServer/Unix/MacOS/site.py ${MDANSE_APP_DIR}/Contents/Resources/.
cp ${CI_PROJECT_DIR}/BuildServer/Unix/MacOS/site.py ${MDANSE_APP_DIR}/Contents/Resources/lib/python2.7/.
chmod 777 ${CI_PROJECT_DIR}/BuildServer/Unix/MacOS/change_dylib_path.sh
......
......@@ -64,7 +64,7 @@ import __builtin__
import traceback
# Prefixes for site-packages; add additional prefixes like /usr/local here
PREFIXES = [sys.prefix, sys.exec_prefix]
PREFIXES = []
# Enable per user site-packages directory
# set it to False to disable the feature or True to force the feature
ENABLE_USER_SITE = None
......@@ -75,6 +75,9 @@ ENABLE_USER_SITE = None
USER_SITE = None
USER_BASE = None
resources_dir = os.path.abspath(os.path.join(os.path.dirname(sys.executable),'..','Resources','lib','python2.7'))
sys.path.append(os.path.join(resources_dir,'site-packages.zip'))
def makepath(*paths):
dir = os.path.join(*paths)
......@@ -586,14 +589,5 @@ def _script():
print textwrap.dedent(help % (sys.argv[0], os.pathsep))
sys.exit(10)
new_sys_path = [p for p in sys.path if not p.startswith("/System") and not p.startswith("/Library")]
sys.path = new_sys_path
resources_dir = os.path.abspath(os.path.join(os.path.dirname(sys.executable),'..','Resources','lib','python2.7'))
sys.path.append(resources_dir)
sys.path.append(os.path.join(resources_dir,'lib-dynload'))
sys.path.append(os.path.join(resources_dir,'site-packages.zip'))
if __name__ == '__main__':
_script()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment