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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
slapos.buildout
Commits
29a8e5dd
Commit
29a8e5dd
authored
Aug 05, 2010
by
Gary Poster
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Windows test fixes.
parent
35f81f2e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
17 deletions
+43
-17
bootstrap/bootstrap.py
bootstrap/bootstrap.py
+11
-6
dev.py
dev.py
+1
-1
src/zc/buildout/easy_install.py
src/zc/buildout/easy_install.py
+16
-5
src/zc/buildout/tests.py
src/zc/buildout/tests.py
+4
-0
src/zc/buildout/virtualenv.txt
src/zc/buildout/virtualenv.txt
+11
-5
No files found.
bootstrap/bootstrap.py
View file @
29a8e5dd
...
@@ -32,12 +32,17 @@ if sys.platform == 'win32':
...
@@ -32,12 +32,17 @@ if sys.platform == 'win32':
else
:
else
:
quote
=
str
quote
=
str
# Detect https://bugs.launchpad.net/virtualenv/+bug/572545 .
# See zc.buildout.easy_install._has_broken_dash_S for motivation and comments.
proc
=
subprocess
.
Popen
(
stdout
,
stderr
=
subprocess
.
Popen
(
[
sys
.
executable
,
'-Sc'
,
'import ConfigParser'
],
[
sys
.
executable
,
'-Sc'
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
'try:
\
n
'
proc
.
communicate
()
' import ConfigParser
\
n
'
has_broken_dash_S
=
bool
(
proc
.
returncode
)
'except ImportError:
\
n
'
' print 1
\
n
'
'else:
\
n
'
' print 0
\
n
'
],
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
).
communicate
()
has_broken_dash_S
=
bool
(
int
(
stdout
.
strip
()))
# In order to be more robust in the face of system Pythons, we want to
# In order to be more robust in the face of system Pythons, we want to
# run without site-packages loaded. This is somewhat tricky, in
# run without site-packages loaded. This is somewhat tricky, in
...
...
dev.py
View file @
29a8e5dd
...
@@ -122,7 +122,7 @@ except ImportError:
...
@@ -122,7 +122,7 @@ except ImportError:
env
=
os
.
environ
.
copy
()
# Windows needs yet-to-be-determined values from this.
env
=
os
.
environ
.
copy
()
# Windows needs yet-to-be-determined values from this.
env
[
'PYTHONPATH'
]
=
os
.
path
.
dirname
(
pkg_resources
.
__file__
)
env
[
'PYTHONPATH'
]
=
os
.
path
.
dirname
(
pkg_resources
.
__file__
)
cmd
=
[
quote
(
sys
.
executable
)
,
cmd
=
[
sys
.
executable
,
'setup.py'
,
'-q'
,
'develop'
,
'-m'
,
'-x'
,
'-d'
,
'develop-eggs'
]
'setup.py'
,
'-q'
,
'develop'
,
'-m'
,
'-x'
,
'-d'
,
'develop-eggs'
]
if
not
has_broken_dash_S
:
if
not
has_broken_dash_S
:
...
...
src/zc/buildout/easy_install.py
View file @
29a8e5dd
...
@@ -85,11 +85,22 @@ if os.path.normpath(setuptools_loc) != os.path.normpath(buildout_loc):
...
@@ -85,11 +85,22 @@ if os.path.normpath(setuptools_loc) != os.path.normpath(buildout_loc):
def
_has_broken_dash_S
(
executable
):
def
_has_broken_dash_S
(
executable
):
"""Detect https://bugs.launchpad.net/virtualenv/+bug/572545 ."""
"""Detect https://bugs.launchpad.net/virtualenv/+bug/572545 ."""
proc
=
subprocess
.
Popen
(
# The first attempt here was to simply have the executable attempt to import
[
executable
,
'-Sc'
,
'import ConfigParser'
],
# ConfigParser and return the return code. That worked except for tests on
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
# Windows, where the return code was wrong for the fake Python executable
proc
.
communicate
()
# generated by the virtualenv.txt test, apparently because setuptools' .exe
return
bool
(
proc
.
returncode
)
# file does not pass the -script.py's returncode back properly, at least in
# some circumstances. Therefore...print statements.
stdout
,
stderr
=
subprocess
.
Popen
(
[
executable
,
'-Sc'
,
'try:
\
n
'
' import ConfigParser
\
n
'
'except ImportError:
\
n
'
' print 1
\
n
'
'else:
\
n
'
' print 0
\
n
'
],
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
).
communicate
()
return
bool
(
int
(
stdout
.
strip
()))
def
_get_system_paths
(
executable
):
def
_get_system_paths
(
executable
):
"""Return lists of standard lib and site paths for executable.
"""Return lists of standard lib and site paths for executable.
...
...
src/zc/buildout/tests.py
View file @
29a8e5dd
...
@@ -4150,6 +4150,10 @@ def test_suite():
...
@@ -4150,6 +4150,10 @@ def test_suite():
'setuptools.egg'),
'setuptools.egg'),
(re.compile('zc.buildout-
\
S+-
'
),
(re.compile('zc.buildout-
\
S+-
'
),
'zc.buildout.egg'),
'zc.buildout.egg'),
(re.compile(re.escape('#!"
/
executable_buildout
/
bin
/
py
"')),
'#!/executable_buildout/bin/py'), # Windows.
(re.compile(re.escape('/broken_s/')),
'/broken_S/'), # Windows.
]),
]),
))
))
...
...
src/zc/buildout/virtualenv.txt
View file @
29a8e5dd
...
@@ -43,11 +43,17 @@ behavior as the problematic one we care about from virtualenv. Let's do that
...
@@ -43,11 +43,17 @@ behavior as the problematic one we care about from virtualenv. Let's do that
first.
first.
>>> import os, sys
>>> import os, sys
>>> from zc.buildout.easy_install import _safe_arg
>>> py_path, site_packages_path = make_py()
>>> py_path, site_packages_path = make_py()
>>> py_file = open(py_path)
>>> if sys.platform == 'win32':
... py_script_path = py_path + '-script.py'
... else:
... py_script_path = py_path
...
>>> py_file = open(py_script_path)
>>> py_lines = py_file.readlines()
>>> py_lines = py_file.readlines()
>>> py_file.close()
>>> py_file.close()
>>> py_file = open(py_path, 'w')
>>> py_file = open(py_
script_
path, 'w')
>>> extra = '''\
>>> extra = '''\
... new_argv = argv[:1]
... new_argv = argv[:1]
... for ix, val in enumerate(argv[1:]):
... for ix, val in enumerate(argv[1:]):
...
@@ -109,11 +115,11 @@ first.
...
@@ -109,11 +115,11 @@ first.
... ''' % (py_path,))
... ''' % (py_path,))
>>> sitecustomize_file.close()
>>> sitecustomize_file.close()
>>> print call_py(
>>> print call_py(
...
py_path
,
...
_safe_arg(py_path)
,
... "import ConfigParser")
... "import ConfigParser")
<BLANKLINE>
<BLANKLINE>
>>> print 'X'; print call_py(
>>> print 'X'; print call_py(
...
py_path
,
...
_safe_arg(py_path)
,
... "import ConfigParser",
... "import ConfigParser",
... '-S') # doctest: +ELLIPSIS
... '-S') # doctest: +ELLIPSIS
X...Traceback (most recent call last):
X...Traceback (most recent call last):
...
@@ -152,7 +158,7 @@ First, let's try running bootstrap.
...
@@ -152,7 +158,7 @@ First, let's try running bootstrap.
... ''')
... ''')
>>> write('bootstrap.py', open(bootstrap_py).read())
>>> write('bootstrap.py', open(bootstrap_py).read())
>>> print 'X'; print system(
>>> print 'X'; print system(
...
zc.buildout.easy_install.
_safe_arg(py_path)+' '+
... _safe_arg(py_path)+' '+
... 'bootstrap.py'); print 'X' # doctest: +ELLIPSIS
... 'bootstrap.py'); print 'X' # doctest: +ELLIPSIS
X...
X...
Generated script '/broken_S/bin/buildout'.
Generated script '/broken_S/bin/buildout'.
...
...
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