Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.buildout
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Xavier Thompson
slapos.buildout
Commits
bbe81a7c
Commit
bbe81a7c
authored
Apr 22, 2020
by
Julien Muchembled
Committed by
Xavier Thompson
Apr 30, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[feat] Omit Python library in script paths
This is useful when using OS Python & eggs. Useless for SlapOS.
parent
cf2d0ed0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
18 deletions
+18
-18
src/zc/buildout/easy_install.py
src/zc/buildout/easy_install.py
+16
-16
src/zc/buildout/tests/easy_install.txt
src/zc/buildout/tests/easy_install.txt
+2
-2
No files found.
src/zc/buildout/easy_install.py
View file @
bbe81a7c
...
...
@@ -20,6 +20,7 @@ installed.
import
copy
import
distutils.errors
import
distutils.sysconfig
import
errno
import
glob
import
logging
...
...
@@ -101,6 +102,8 @@ pip_path = setuptools_path = [
]
pip_pythonpath
=
setuptools_pythonpath
=
os
.
pathsep
.
join
(
pip_path
)
python_lib
=
distutils
.
sysconfig
.
get_python_lib
()
FILE_SCHEME
=
re
.
compile
(
'file://'
,
re
.
I
).
match
DUNDER_FILE_PATTERN
=
re
.
compile
(
r"__file__ = '(?P<filename>.+)'$"
)
...
...
@@ -1159,6 +1162,10 @@ def scripts(reqs, working_set, executable, dest=None,
if
p
not
in
unique_path
:
unique_path
.
append
(
p
)
path
=
[
realpath
(
p
)
for
p
in
unique_path
]
try
:
path
.
remove
(
python_lib
)
except
ValueError
:
pass
generated
=
[]
...
...
@@ -1329,6 +1336,12 @@ join = os.path.join
base = os.path.dirname(os.path.abspath(os.path.realpath(__file__)))
"""
def
_initialization
(
path
,
initialization
):
return
"""sys.path[0:0] = [
%s,
]
"""
%
path
+
initialization
if
path
else
initialization
def
_script
(
module_name
,
attrs
,
path
,
dest
,
arguments
,
initialization
,
rsetup
):
if
is_win32
:
dest
+=
'-script.py'
...
...
@@ -1337,11 +1350,10 @@ def _script(module_name, attrs, path, dest, arguments, initialization, rsetup):
contents
=
script_template
%
dict
(
python
=
python
,
path
=
path
,
module_name
=
module_name
,
attrs
=
attrs
,
arguments
=
arguments
,
initialization
=
initialization
,
initialization
=
_initialization
(
path
,
initialization
)
,
relative_paths_setup
=
rsetup
,
)
return
_create_script
(
contents
,
dest
)
...
...
@@ -1374,8 +1386,7 @@ def _distutils_script(path, dest, script_content, initialization, rsetup):
contents
=
distutils_script_template
%
dict
(
python
=
python
,
path
=
path
,
initialization
=
initialization
,
initialization
=
_initialization
(
path
,
initialization
),
relative_paths_setup
=
rsetup
,
before
=
before
,
after
=
after
...
...
@@ -1443,9 +1454,6 @@ script_template = script_header + '''\
%(relative_paths_setup)s
import sys
sys.path[0:0] = [
%(path)s,
]
%(initialization)s
import %(module_name)s
...
...
@@ -1457,9 +1465,6 @@ distutils_script_template = script_header + '''
%(before)s
%(relative_paths_setup)s
import sys
sys.path[0:0] = [
%(path)s,
]
%(initialization)s
%(after)s'''
...
...
@@ -1472,14 +1477,12 @@ def _pyscript(path, dest, rsetup, initialization=''):
dest
+=
'-script.py'
python
=
_safe_arg
(
sys
.
executable
)
if
path
:
path
+=
','
# Courtesy comma at the end of the list.
contents
=
py_script_template
%
dict
(
python
=
python
,
path
=
path
,
relative_paths_setup
=
rsetup
,
initialization
=
initialization
,
initialization
=
_initialization
(
path
,
initialization
)
,
)
changed
=
_file_changed
(
dest
,
contents
)
...
...
@@ -1514,9 +1517,6 @@ py_script_template = script_header + '''\
%%(relative_paths_setup)s
import sys
sys.path[0:0] = [
%%(path)s
]
%%(initialization)s
_interactive = True
...
...
src/zc/buildout/tests/easy_install.txt
View file @
bbe81a7c
...
...
@@ -765,9 +765,9 @@ An interpreter can also be generated without other eggs:
<BLANKLINE>
import sys
<BLANKLINE>
sys.path[0:0] = [
<BLANKLINE>
]
<BLANKLINE>
_interactive = True
...
An additional argument can be passed to define which scripts to install
...
...
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