Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Scientific Software
MDANSE
Commits
80495793
Commit
80495793
authored
Jul 25, 2018
by
eric pellegrini
Browse files
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
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
BuildServer/Unix/MacOS/deploy.sh
View file @
80495793
...
...
@@ -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
...
...
BuildServer/Unix/MacOS/site.py
View file @
80495793
...
...
@@ -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
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment