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
8066cd28
Commit
8066cd28
authored
Jul 18, 2008
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added an api to change the default policy for unzipping zip-safe eggs.
parent
69313b6d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
3 deletions
+50
-3
src/zc/buildout/easy_install.py
src/zc/buildout/easy_install.py
+11
-3
src/zc/buildout/easy_install.txt
src/zc/buildout/easy_install.txt
+39
-0
No files found.
src/zc/buildout/easy_install.py
View file @
8066cd28
...
...
@@ -125,13 +125,14 @@ class Installer:
_prefer_final = True
_use_dependency_links = True
_allow_picked_versions = True
_always_unzip = False
def __init__(self,
dest=None,
links=(),
index=None,
executable=sys.executable,
always_unzip=
Fals
e,
always_unzip=
Non
e,
path=None,
newest=True,
versions=None,
...
...
@@ -156,7 +157,8 @@ class Installer:
self._index_url = index
self._executable = executable
self._always_unzip = always_unzip
if always_unzip is not None:
self._always_unzip = always_unzip
path = (path and path[:] or []) + buildout_and_setuptools_path
if dest is not None and dest not in path:
path.insert(0, dest)
...
...
@@ -740,9 +742,15 @@ def allow_picked_versions(setting=None):
Installer
.
_allow_picked_versions
=
bool
(
setting
)
return
old
def
always_unzip
(
setting
=
None
):
old
=
Installer
.
_always_unzip
if
setting
is
not
None
:
Installer
.
_always_unzip
=
bool
(
setting
)
return
old
def
install
(
specs
,
dest
,
links
=
(),
index
=
None
,
executable
=
sys
.
executable
,
always_unzip
=
Fals
e
,
executable
=
sys
.
executable
,
always_unzip
=
Non
e
,
path
=
None
,
working_set
=
None
,
newest
=
True
,
versions
=
None
,
use_dependency_links
=
None
,
allow_hosts
=
(
'*'
,)):
installer
=
Installer
(
dest
,
links
,
index
,
executable
,
always_unzip
,
path
,
...
...
src/zc/buildout/easy_install.txt
View file @
8066cd28
...
...
@@ -220,6 +220,45 @@ can be useful when debugging.
d demo-0.3-py2.4.egg
d demoneeded-1.1-py2.4.egg
>>> rmdir(dest)
>>> dest = tmpdir('sample-install')
>>> ws = zc.buildout.easy_install.install(
... ['demo'], dest, links=[link_server], index=link_server+'index/',
... always_unzip=False)
>>> ls(dest)
- demo-0.3-py2.4.egg
- demoneeded-1.1-py2.4.egg
We can also set a default by calling the always_unzip function:
>>> zc.buildout.easy_install.always_unzip(True)
False
The old default is returned:
>>> rmdir(dest)
>>> dest = tmpdir('sample-install')
>>> ws = zc.buildout.easy_install.install(
... ['demo'], dest, links=[link_server], index=link_server+'index/')
>>> ls(dest)
d demo-0.3-py2.4.egg
d demoneeded-1.1-py2.4.egg
>>> zc.buildout.easy_install.always_unzip(False)
True
>>> rmdir(dest)
>>> dest = tmpdir('sample-install')
>>> ws = zc.buildout.easy_install.install(
... ['demo'], dest, links=[link_server], index=link_server+'index/')
>>> ls(dest)
- demo-0.3-py2.4.egg
- demoneeded-1.1-py2.4.egg
>>> rmdir(dest)
>>> dest = tmpdir('sample-install')
>>> ws = zc.buildout.easy_install.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