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':
else
:
quote
=
str
# Detect https://bugs.launchpad.net/virtualenv/+bug/572545 .
proc
=
subprocess
.
Popen
(
[
sys
.
executable
,
'-Sc'
,
'import ConfigParser'
],
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
proc
.
communicate
()
has_broken_dash_S
=
bool
(
proc
.
returncode
)
# See zc.buildout.easy_install._has_broken_dash_S for motivation and comments.
stdout
,
stderr
=
subprocess
.
Popen
(
[
sys
.
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
()
has_broken_dash_S
=
bool
(
int
(
stdout
.
strip
()))
# 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
...
...
dev.py
View file @
29a8e5dd
...
...
@@ -122,7 +122,7 @@ except ImportError:
env
=
os
.
environ
.
copy
()
# Windows needs yet-to-be-determined values from this.
env
[
'PYTHONPATH'
]
=
os
.
path
.
dirname
(
pkg_resources
.
__file__
)
cmd
=
[
quote
(
sys
.
executable
)
,
cmd
=
[
sys
.
executable
,
'setup.py'
,
'-q'
,
'develop'
,
'-m'
,
'-x'
,
'-d'
,
'develop-eggs'
]
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):
def
_has_broken_dash_S
(
executable
):
"""Detect https://bugs.launchpad.net/virtualenv/+bug/572545 ."""
proc
=
subprocess
.
Popen
(
[
executable
,
'-Sc'
,
'import ConfigParser'
],
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
proc
.
communicate
()
return
bool
(
proc
.
returncode
)
# The first attempt here was to simply have the executable attempt to import
# ConfigParser and return the return code. That worked except for tests on
# Windows, where the return code was wrong for the fake Python executable
# generated by the virtualenv.txt test, apparently because setuptools' .exe
# 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
):
"""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():
'setuptools.egg'),
(re.compile('zc.buildout-
\
S+-
'
),
'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
first.
>>> import os, sys
>>> from zc.buildout.easy_install import _safe_arg
>>> 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_file.close()
>>> py_file = open(py_path, 'w')
>>> py_file = open(py_
script_
path, 'w')
>>> extra = '''\
... new_argv = argv[:1]
... for ix, val in enumerate(argv[1:]):
...
...
@@ -109,11 +115,11 @@ first.
... ''' % (py_path,))
>>> sitecustomize_file.close()
>>> print call_py(
...
py_path
,
...
_safe_arg(py_path)
,
... "import ConfigParser")
<BLANKLINE>
>>> print 'X'; print call_py(
...
py_path
,
...
_safe_arg(py_path)
,
... "import ConfigParser",
... '-S') # doctest: +ELLIPSIS
X...Traceback (most recent call last):
...
...
@@ -152,7 +158,7 @@ First, let's try running bootstrap.
... ''')
>>> write('bootstrap.py', open(bootstrap_py).read())
>>> print 'X'; print system(
...
zc.buildout.easy_install.
_safe_arg(py_path)+' '+
... _safe_arg(py_path)+' '+
... 'bootstrap.py'); print 'X' # doctest: +ELLIPSIS
X...
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