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
Łukasz Nowak
slapos.buildout
Commits
fc897d37
Commit
fc897d37
authored
Aug 28, 2009
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug fixed:
The standard Python -m option didn't work for custom interpreters.
parent
125784d9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
14 deletions
+41
-14
CHANGES.txt
CHANGES.txt
+2
-0
src/zc/buildout/easy_install.py
src/zc/buildout/easy_install.py
+9
-4
src/zc/buildout/easy_install.txt
src/zc/buildout/easy_install.txt
+30
-10
No files found.
CHANGES.txt
View file @
fc897d37
...
@@ -22,6 +22,8 @@ Bugs fixed:
...
@@ -22,6 +22,8 @@ Bugs fixed:
- Scripts run using generated interpreters didn't have __file__ set correctly.
- Scripts run using generated interpreters didn't have __file__ set correctly.
- The standard Python -m option didn't work for custom interpreters.
1.4.0 (2009-08-26)
1.4.0 (2009-08-26)
==================
==================
...
...
src/zc/buildout/easy_install.py
View file @
fc897d37
...
@@ -1127,23 +1127,28 @@ sys.path[0:0] = [
...
@@ -1127,23 +1127,28 @@ sys.path[0:0] = [
_interactive = True
_interactive = True
if len(sys.argv) > 1:
if len(sys.argv) > 1:
import getopt
_options, _args = __import__("getopt").getopt(sys.argv[1:], 'ic:m:')
_options, _args = getopt.getopt(sys.argv[1:], 'ic:')
_interactive = False
_interactive = False
for (_opt, _val) in _options:
for (_opt, _val) in _options:
if _opt == '-i':
if _opt == '-i':
_interactive = True
_interactive = True
elif _opt == '-c':
elif _opt == '-c':
exec _val
exec _val
elif _opt == '-m':
sys.argv[1:] = _args
_args = []
__import__("runpy").run_module(
_val, {}, "__main__", alter_sys=True)
if _args:
if _args:
sys.argv[:] = _args
sys.argv[:] = _args
__file__ = _args[0]
__file__ = _args[0]
del _options, _args
execfile(__file__)
execfile(__file__)
if _interactive:
if _interactive:
import cod
e
del _interactiv
e
code
.interact(banner="", local=globals())
__import__("code")
.interact(banner="", local=globals())
'''
'''
runsetup_template
=
"""
runsetup_template
=
"""
...
...
src/zc/buildout/easy_install.txt
View file @
fc897d37
...
@@ -663,32 +663,38 @@ the path set:
...
@@ -663,32 +663,38 @@ the path set:
>>> cat(bin, 'py') # doctest: +NORMALIZE_WHITESPACE
>>> cat(bin, 'py') # doctest: +NORMALIZE_WHITESPACE
#!/usr/local/bin/python2.4
#!/usr/local/bin/python2.4
<BLANKLINE>
import sys
import sys
<BLANKLINE>
<BLANKLINE>
sys.path[0:0] = [
sys.path[0:0] = [
'/sample-install/demo-0.3-py
2.4
.egg',
'/sample-install/demo-0.3-py
N.N
.egg',
'/sample-install/demoneeded-1.1-py
2.4
.egg',
'/sample-install/demoneeded-1.1-py
N.N
.egg',
]
]
<BLANKLINE>
<BLANKLINE>
_interactive = True
_interactive = True
if len(sys.argv) > 1:
if len(sys.argv) > 1:
import getopt
_options, _args = __import__("getopt").getopt(sys.argv[1:], 'ic:m:')
_options, _args = getopt.getopt(sys.argv[1:], 'ic:')
_interactive = False
_interactive = False
for (_opt, _val) in _options:
for (_opt, _val) in _options:
if _opt == '-i':
if _opt == '-i':
_interactive = True
_interactive = True
elif _opt == '-c':
elif _opt == '-c':
exec _val
exec _val
elif _opt == '-m':
sys.argv[1:] = _args
_args = []
__import__("runpy").run_module(
_val, {}, "__main__", alter_sys=True)
<BLANKLINE>
<BLANKLINE>
if _args:
if _args:
sys.argv[:] = _args
sys.argv[:] = _args
__file__ = _args[0]
__file__ = _args[0]
del _options, _args
execfile(__file__)
execfile(__file__)
<BLANKLINE>
<BLANKLINE>
if _interactive:
if _interactive:
import cod
e
del _interactiv
e
code
.interact(banner="", local=globals())
__import__("code")
.interact(banner="", local=globals())
If invoked with a script name and arguments, it will run that script, instead.
If invoked with a script name and arguments, it will run that script, instead.
...
@@ -701,6 +707,15 @@ If invoked with a script name and arguments, it will run that script, instead.
...
@@ -701,6 +707,15 @@ If invoked with a script name and arguments, it will run that script, instead.
['ascript', 'a', 'b', 'c']
['ascript', 'a', 'b', 'c']
('__main__', 'ascript', 'demo doc')
('__main__', 'ascript', 'demo doc')
For Python 2.5 and higher, you can also use the -m option to run a
module:
>>> print system(join(bin, 'py')+' -m pdb'),
usage: pdb.py scriptfile [arg] ...
>>> print system(join(bin, 'py')+' -m pdb what'),
Error: what does not exist
An additional argument can be passed to define which scripts to install
An additional argument can be passed to define which scripts to install
and to provide script names. The argument is a dictionary mapping
and to provide script names. The argument is a dictionary mapping
original script names to new script names.
original script names to new script names.
...
@@ -873,23 +888,28 @@ We specified an interpreter and its paths are adjusted too:
...
@@ -873,23 +888,28 @@ We specified an interpreter and its paths are adjusted too:
<BLANKLINE>
<BLANKLINE>
_interactive = True
_interactive = True
if len(sys.argv) > 1:
if len(sys.argv) > 1:
import getopt
_options, _args = __import__("getopt").getopt(sys.argv[1:], 'ic:m:')
_options, _args = getopt.getopt(sys.argv[1:], 'ic:')
_interactive = False
_interactive = False
for (_opt, _val) in _options:
for (_opt, _val) in _options:
if _opt == '-i':
if _opt == '-i':
_interactive = True
_interactive = True
elif _opt == '-c':
elif _opt == '-c':
exec _val
exec _val
elif _opt == '-m':
sys.argv[1:] = _args
_args = []
__import__("runpy").run_module(
_val, {}, "__main__", alter_sys=True)
<BLANKLINE>
<BLANKLINE>
if _args:
if _args:
sys.argv[:] = _args
sys.argv[:] = _args
__file__ = _args[0]
__file__ = _args[0]
del _options, _args
execfile(__file__)
execfile(__file__)
<BLANKLINE>
<BLANKLINE>
if _interactive:
if _interactive:
import cod
e
del _interactiv
e
code
.interact(banner="", local=globals())
__import__("code")
.interact(banner="", local=globals())
Handling custom build options for extensions provided in source distributions
Handling custom build options for extensions provided in source distributions
...
...
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