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
35f26d0e
Commit
35f26d0e
authored
Dec 04, 2017
by
Kirill Kuzminykh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added sorting of working set used by zc.recipe.egg
parent
a77a7577
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
+28
-0
zc.recipe.egg_/src/zc/recipe/egg/egg.py
zc.recipe.egg_/src/zc/recipe/egg/egg.py
+28
-0
No files found.
zc.recipe.egg_/src/zc/recipe/egg/egg.py
View file @
35f26d0e
...
@@ -15,8 +15,10 @@
...
@@ -15,8 +15,10 @@
"""
"""
import
copy
import
copy
import
glob
import
logging
import
logging
import
os
import
os
import
pkg_resources
import
re
import
re
import
sys
import
sys
import
zc.buildout.easy_install
import
zc.buildout.easy_install
...
@@ -90,6 +92,31 @@ class Eggs(object):
...
@@ -90,6 +92,31 @@ class Eggs(object):
update
=
install
update
=
install
def
_sort_working_set
(
self
,
ws
):
develop_paths
=
set
()
pattern
=
os
.
path
.
join
(
self
.
options
[
'develop-eggs-directory'
],
'*.egg-link'
)
for
egg_link
in
glob
.
glob
(
pattern
):
with
open
(
egg_link
,
'rt'
)
as
f
:
path
=
f
.
readline
().
strip
()
if
path
:
develop_paths
.
add
(
path
)
egg_directory
=
os
.
path
.
join
(
self
.
options
[
'eggs-directory'
],
''
)
sorted_paths
=
[]
egg_paths
=
[]
other_paths
=
[]
for
dist
in
ws
:
path
=
dist
.
location
if
path
in
develop_paths
:
sorted_paths
.
append
(
path
)
elif
os
.
path
.
commonprefix
([
path
,
egg_directory
])
==
egg_directory
:
egg_paths
.
append
(
path
)
else
:
other_paths
.
append
(
path
)
sorted_paths
.
extend
(
egg_paths
)
sorted_paths
.
extend
(
other_paths
)
return
pkg_resources
.
WorkingSet
(
sorted_paths
)
def
_working_set
(
def
_working_set
(
self
,
self
,
distributions
,
distributions
,
...
@@ -133,6 +160,7 @@ class Eggs(object):
...
@@ -133,6 +160,7 @@ class Eggs(object):
path
=
[
develop_eggs_dir
],
path
=
[
develop_eggs_dir
],
newest
=
newest
,
newest
=
newest
,
allow_hosts
=
allow_hosts
)
allow_hosts
=
allow_hosts
)
ws
=
self
.
_sort_working_set
(
ws
)
cache_storage
[
cache_key
]
=
ws
cache_storage
[
cache_key
]
=
ws
# `pkg_resources.WorkingSet` instances are mutable, so we need to return
# `pkg_resources.WorkingSet` instances are mutable, so we need to return
...
...
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