Commit d235df43 authored by eric pellegrini's avatar eric pellegrini

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

parent 87382ea2
Pipeline #4237 failed with stages
in 11 minutes and 29 seconds
......@@ -87,7 +87,8 @@ 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/Frameworks/Python.framework/Versions/2.7/lib/python2.7/.
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
${CI_PROJECT_DIR}/BuildServer/Unix/MacOS/change_dylib_path.sh
......
......@@ -586,9 +586,10 @@ def _script():
print textwrap.dedent(help % (sys.argv[0], os.pathsep))
sys.exit(10)
site_file_dir = os.path.abspath(os.path.dirname(__file__))
contents_dir = os.path.join(*([site_file_dir]+[os.path.pardir]*6))
resources_dir = os.path.abspath(os.path.join(contents_dir,'Resources','lib','python2.7'))
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'))
......
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