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
6
Merge Requests
6
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
slapos.buildout
Commits
b3c0829a
Commit
b3c0829a
authored
Dec 14, 2009
by
Gary Poster
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add option to script generation in zc.recipe.egg to import site.
parent
9aee1376
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
17 deletions
+31
-17
zc.recipe.egg_/src/zc/recipe/egg/api.txt
zc.recipe.egg_/src/zc/recipe/egg/api.txt
+6
-3
zc.recipe.egg_/src/zc/recipe/egg/egg.py
zc.recipe.egg_/src/zc/recipe/egg/egg.py
+21
-10
zc.recipe.egg_/src/zc/recipe/egg/tests.py
zc.recipe.egg_/src/zc/recipe/egg/tests.py
+4
-4
No files found.
zc.recipe.egg_/src/zc/recipe/egg/api.txt
View file @
b3c0829a
...
...
@@ -95,6 +95,7 @@ We can see that the options were augmented with additional data
computed by the egg recipe by looking at .installed.cfg:
>>> cat(sample_buildout, '.installed.cfg')
... # doctest: +NORMALIZE_WHITESPACE
[buildout]
installed_develop_eggs = /sample-buildout/develop-eggs/sample.egg-link
parts = sample-part
...
...
@@ -115,7 +116,9 @@ computed by the egg recipe by looking at .installed.cfg:
executable = /usr/local/bin/python2.3
extras = other
find-links = http://localhost:27071/
include-site-packages = false
index = http://localhost:27071/index
python = buildout
recipe = sample
If we use the extra-paths option:
...
...
zc.recipe.egg_/src/zc/recipe/egg/egg.py
View file @
b3c0829a
...
...
@@ -52,7 +52,7 @@ class Eggs(object):
# verify that this is None, 'true' or 'false'
get_bool
(
options
,
'unzip'
)
python
=
options
.
ge
t
(
'python'
,
b_options
[
'python'
])
python
=
options
.
setdefaul
t
(
'python'
,
b_options
[
'python'
])
options
[
'executable'
]
=
buildout
[
python
][
'executable'
]
def
working_set
(
self
,
extra
=
()):
...
...
@@ -70,10 +70,11 @@ class Eggs(object):
orig_distributions
=
distributions
[:]
distributions
.
extend
(
extra
)
if
self
.
buildout
[
'buildout'
]
.
get
(
'offline'
)
==
'true'
:
if
b_options
.
get
(
'offline'
)
==
'true'
:
ws
=
zc
.
buildout
.
easy_install
.
working_set
(
distributions
,
options
[
'executable'
],
[
options
[
'develop-eggs-directory'
],
options
[
'eggs-directory'
]]
[
options
[
'develop-eggs-directory'
],
options
[
'eggs-directory'
]],
)
else
:
kw
=
{}
...
...
@@ -85,7 +86,7 @@ class Eggs(object):
index
=
self
.
index
,
executable
=
options
[
'executable'
],
path
=
[
options
[
'develop-eggs-directory'
]],
newest
=
self
.
buildout
[
'buildout'
]
.
get
(
'newest'
)
==
'true'
,
newest
=
b_options
.
get
(
'newest'
)
==
'true'
,
allow_hosts
=
self
.
allow_hosts
,
**
kw
)
...
...
@@ -102,11 +103,13 @@ class Scripts(Eggs):
def
__init__
(
self
,
buildout
,
name
,
options
):
super
(
Scripts
,
self
).
__init__
(
buildout
,
name
,
options
)
options
[
'bin-directory'
]
=
buildout
[
'buildout'
][
'bin-directory'
]
b_options
=
buildout
[
'buildout'
]
options
[
'bin-directory'
]
=
b_options
[
'bin-directory'
]
options
[
'_b'
]
=
options
[
'bin-directory'
]
# backward compat.
self
.
extra_paths
=
[
os
.
path
.
join
(
b
uildout
[
'buildout'
]
[
'directory'
],
p
.
strip
())
os
.
path
.
join
(
b
_options
[
'directory'
],
p
.
strip
())
for
p
in
options
.
get
(
'extra-paths'
,
''
).
split
(
'
\
n
'
)
if
p
.
strip
()
]
...
...
@@ -115,16 +118,23 @@ class Scripts(Eggs):
relative_paths
=
options
.
get
(
'relative-paths'
,
buildout
[
'buildout'
].
get
(
'relative-paths'
,
'false'
)
)
'relative-paths'
,
b_options
.
get
(
'relative-paths'
,
'false'
))
if
relative_paths
==
'true'
:
options
[
'buildout-directory'
]
=
b
uildout
[
'buildout'
]
[
'directory'
]
options
[
'buildout-directory'
]
=
b
_options
[
'directory'
]
self
.
_relative_paths
=
options
[
'buildout-directory'
]
else
:
self
.
_relative_paths
=
''
assert
relative_paths
==
'false'
value
=
options
.
setdefault
(
'include-site-packages'
,
b_options
.
get
(
'include-site-packages'
,
'false'
))
if
value
not
in
(
'true'
,
'false'
):
raise
zc
.
buildout
.
UserError
(
"Invalid value for include-site-packages option: %s"
%
(
value
,))
self
.
include_site_packages
=
(
value
==
'true'
)
parse_entry_point
=
re
.
compile
(
'([^=]+)=(
\
w+(?:[.]
\
w+)*):(
\
w+(?:[.]
\
w+)*)$'
).
match
...
...
@@ -167,6 +177,7 @@ class Scripts(Eggs):
initialization
=
options
.
get
(
'initialization'
,
''
),
arguments
=
options
.
get
(
'arguments'
,
''
),
relative_paths
=
self
.
_relative_paths
,
import_site
=
self
.
include_site_packages
,
)
return
()
...
...
zc.recipe.egg_/src/zc/recipe/egg/tests.py
View file @
b3c0829a
...
...
@@ -67,7 +67,7 @@ def test_suite():
'setuptools-
\
S+
\
s+'
'zc.buildout-
\
S+
\
s*'
),
'__buildout_signature__ = sample- zc.recipe.egg-'
),
'__buildout_signature__ = sample- zc.recipe.egg-
\
n
'
),
(
re
.
compile
(
'executable = [
\
S ]+py
t
hon
\
S*
'
, re.I),
'
executable
=
python
'),
(re.compile('
find
-
links
=
http
:
//
localhost
:
\
d
+/
'),
...
...
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