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
Boxiang Sun
slapos.buildout
Commits
c37f0a49
Commit
c37f0a49
authored
Apr 28, 2020
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixup! buildout.py: Optimize _install_and_load by using cache.
parent
27a43288
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
src/zc/buildout/buildout.py
src/zc/buildout/buildout.py
+4
-4
No files found.
src/zc/buildout/buildout.py
View file @
c37f0a49
...
@@ -1356,10 +1356,11 @@ _install_and_load_cache = {}
...
@@ -1356,10 +1356,11 @@ _install_and_load_cache = {}
def
_install_and_load
(
spec
,
group
,
entry
,
buildout
):
def
_install_and_load
(
spec
,
group
,
entry
,
buildout
):
__doing__
=
'Loading recipe %r.'
,
spec
__doing__
=
'Loading recipe %r.'
,
spec
key
=
spec
,
group
,
entry
try
:
try
:
return
_install_and_load_cache
[(
spec
,
group
,
entry
)
]
return
_install_and_load_cache
[
key
]
except
KeyError
:
except
KeyError
:
pass
pass
try
:
try
:
req
=
pkg_resources
.
Requirement
.
parse
(
spec
)
req
=
pkg_resources
.
Requirement
.
parse
(
spec
)
...
@@ -1387,9 +1388,8 @@ def _install_and_load(spec, group, entry, buildout):
...
@@ -1387,9 +1388,8 @@ def _install_and_load(spec, group, entry, buildout):
)
)
__doing__
=
'Loading %s recipe entry %s:%s.'
,
group
,
spec
,
entry
__doing__
=
'Loading %s recipe entry %s:%s.'
,
group
,
spec
,
entry
result
=
pkg_resources
.
load_entry_point
(
result
=
_install_and_load_cache
[
key
]
=
pkg_resources
.
load_entry_point
(
req
.
project_name
,
group
,
entry
)
req
.
project_name
,
group
,
entry
)
_install_and_load_cache
[(
spec
,
group
,
entry
)]
=
result
return
result
return
result
except
Exception
:
except
Exception
:
...
...
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