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
Nicolas Wavrant
slapos.buildout
Commits
83877a21
Commit
83877a21
authored
Nov 01, 2014
by
Alex Clark ☺
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #199 from reinout/reinout-fix-for-193
Fix for buildout 2.2.3 upgrade/downgrade problems
parents
2226a2ea
aed82c07
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
17 deletions
+36
-17
CHANGES.rst
CHANGES.rst
+9
-0
src/zc/buildout/easy_install.py
src/zc/buildout/easy_install.py
+27
-17
No files found.
CHANGES.rst
View file @
83877a21
Change History
Change History
**************
**************
2.2. (unreleased)
==================
- Fix for #198: buildout 2.2.3 caused a version conflict when bootstrapping a
buildout with a version pinned to an earlier one. Same version conflict
could occur with system-wide installed packages that were newer than the
pinned version.
[reinout]
2.2.3 (2014-10-30)
2.2.3 (2014-10-30)
==================
==================
...
...
src/zc/buildout/easy_install.py
View file @
83877a21
...
@@ -635,25 +635,33 @@ class Installer:
...
@@ -635,25 +635,33 @@ class Installer:
# zc.buildout.tests).
# zc.buildout.tests).
requirements
.
reverse
()
# Set up the stack.
requirements
.
reverse
()
# Set up the stack.
processed
=
{}
# This is a set of processed requirements.
processed
=
{}
# This is a set of processed requirements.
best
=
{}
# This is a mapping of
key
-> dist.
best
=
{}
# This is a mapping of
package name
-> dist.
# Note that we don't use the existing environment, because we want
# Note that we don't use the existing environment, because we want
# to look for new eggs unless what we have is the best that
# to look for new eggs unless what we have is the best that
# matches the requirement.
# matches the requirement.
env
=
pkg_resources
.
Environment
(
ws
.
entries
)
env
=
pkg_resources
.
Environment
(
ws
.
entries
)
while
requirements
:
while
requirements
:
# Process dependencies breadth-first.
# Process dependencies breadth-first.
req
=
self
.
_constrain
(
requirements
.
pop
(
0
))
current_requirement
=
requirements
.
pop
(
0
)
req
=
self
.
_constrain
(
current_requirement
)
if
req
in
processed
:
if
req
in
processed
:
# Ignore cyclic or redundant dependencies.
# Ignore cyclic or redundant dependencies.
continue
continue
dist
=
best
.
get
(
req
.
key
)
dist
=
best
.
get
(
req
.
key
)
if
dist
is
None
:
# Find the best distribution and add it to the map.
dist
=
ws
.
by_key
.
get
(
req
.
key
)
if
dist
is
None
:
if
dist
is
None
:
try
:
try
:
dist
=
best
[
req
.
key
]
=
env
.
best_match
(
req
,
ws
)
dist
=
env
.
best_match
(
req
,
ws
)
except
pkg_resources
.
VersionConflict
as
err
:
except
pkg_resources
.
VersionConflict
as
err
:
logger
.
debug
(
"Version conflict while processing requirement %s "
"(constrained to %s)"
,
current_requirement
,
req
)
# When bootstrapping zc.buildout, we might be doing it
# with a different version than the one we specified in
# our versions list. Reason: the bootstrap grabs the
# latest buildout. Same with setuptools.
# So ignore the version conflict for those two packages.
if
req
.
key
not
in
[
'zc.buildout'
,
'setuptools'
]:
raise
VersionConflict
(
err
,
ws
)
raise
VersionConflict
(
err
,
ws
)
if
dist
is
None
:
if
dist
is
None
:
if
dest
:
if
dest
:
...
@@ -668,6 +676,8 @@ class Installer:
...
@@ -668,6 +676,8 @@ class Installer:
# Oops, the "best" so far conflicts with a dependency.
# Oops, the "best" so far conflicts with a dependency.
raise
VersionConflict
(
raise
VersionConflict
(
pkg_resources
.
VersionConflict
(
dist
,
req
),
ws
)
pkg_resources
.
VersionConflict
(
dist
,
req
),
ws
)
best
[
req
.
key
]
=
dist
requirements
.
extend
(
dist
.
requires
(
req
.
extras
)[::
-
1
])
requirements
.
extend
(
dist
.
requires
(
req
.
extras
)[::
-
1
])
processed
[
req
]
=
True
processed
[
req
]
=
True
return
ws
return
ws
...
...
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