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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
slapos.buildout
Commits
af496836
Commit
af496836
authored
Dec 04, 2017
by
Reinout van Rees
Committed by
GitHub
Dec 04, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #432 from Cykooz/master
Added sorting of working set used by zc.recipe.egg
parents
a77a7577
1b4dee29
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
1 deletion
+30
-1
zc.recipe.egg_/CHANGES.rst
zc.recipe.egg_/CHANGES.rst
+2
-1
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_/CHANGES.rst
View file @
af496836
...
...
@@ -4,7 +4,8 @@ Change History
2.0.5 (unreleased)
==================
- Nothing changed yet.
- Fix #429: added sorting of working set by priority of different
type of paths (develop-eggs-directory, eggs-directory, other paths).
2.0.4 (2017-08-17)
...
...
zc.recipe.egg_/src/zc/recipe/egg/egg.py
View file @
af496836
...
...
@@ -15,8 +15,10 @@
"""
import
copy
import
glob
import
logging
import
os
import
pkg_resources
import
re
import
sys
import
zc.buildout.easy_install
...
...
@@ -90,6 +92,31 @@ class Eggs(object):
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
(
self
,
distributions
,
...
...
@@ -133,6 +160,7 @@ class Eggs(object):
path
=
[
develop_eggs_dir
],
newest
=
newest
,
allow_hosts
=
allow_hosts
)
ws
=
self
.
_sort_working_set
(
ws
)
cache_storage
[
cache_key
]
=
ws
# `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