Commit 24d5b0bb authored by Julien Muchembled's avatar Julien Muchembled Committed by Xavier Thompson

[feat] Explain egg dependencies when an egg fails to install

parent 97726868
...@@ -242,6 +242,10 @@ def dist_needs_pkg_resources(dist): ...@@ -242,6 +242,10 @@ def dist_needs_pkg_resources(dist):
) )
_doing_list = type('', (), {'__mod__': staticmethod(
lambda x: '\n '.join(*x))})()
class Installer(object): class Installer(object):
_versions = {} _versions = {}
...@@ -693,6 +697,7 @@ class Installer(object): ...@@ -693,6 +697,7 @@ class Installer(object):
def install(self, specs, working_set=None): def install(self, specs, working_set=None):
logger.debug('Installing %s.', repr(specs)[1:-1]) logger.debug('Installing %s.', repr(specs)[1:-1])
__doing__ = _doing_list, self._requirements_and_constraints
self._requirements_and_constraints.append( self._requirements_and_constraints.append(
"Base installation request: %s" % repr(specs)[1:-1]) "Base installation request: %s" % repr(specs)[1:-1])
......
...@@ -40,6 +40,7 @@ Now we can run the buildout and see that it fails: ...@@ -40,6 +40,7 @@ Now we can run the buildout and see that it fails:
... ...
While: While:
Installing eggs. Installing eggs.
Base installation request: 'allowdemo[bad_extra]'
Error: Couldn't find the required extra... Error: Couldn't find the required extra...
If we flip the option on, the buildout succeeds If we flip the option on, the buildout succeeds
......
...@@ -61,6 +61,8 @@ Now we can run the buildout and make sure all attempts to dist.plone.org fails:: ...@@ -61,6 +61,8 @@ Now we can run the buildout and make sure all attempts to dist.plone.org fails::
... ...
While: While:
Installing eggs. Installing eggs.
Base installation request: 'allowdemo'
Requirement of allowdemo: kss.core
Getting distribution for 'kss.core'. Getting distribution for 'kss.core'.
Error: Couldn't find a distribution for 'kss.core'. Error: Couldn't find a distribution for 'kss.core'.
...@@ -92,6 +94,8 @@ Now we can run the buildout and make sure all attempts to dist.plone.org fails:: ...@@ -92,6 +94,8 @@ Now we can run the buildout and make sure all attempts to dist.plone.org fails::
... ...
While: While:
Installing eggs. Installing eggs.
Base installation request: 'allowdemo'
Requirement of allowdemo: kss.core
Getting distribution for 'kss.core'. Getting distribution for 'kss.core'.
Error: Couldn't find a distribution for 'kss.core'. Error: Couldn't find a distribution for 'kss.core'.
......
...@@ -87,6 +87,8 @@ buildout to see where the egg comes from this time. ...@@ -87,6 +87,8 @@ buildout to see where the egg comes from this time.
... ...
While: While:
Updating eggs. Updating eggs.
Base installation request: 'depdemo'
Requirement of depdemo: demoneeded
Getting distribution for 'demoneeded'. Getting distribution for 'demoneeded'.
Error: Couldn't find a distribution for 'demoneeded'. Error: Couldn't find a distribution for 'demoneeded'.
......
...@@ -207,6 +207,7 @@ versions: ...@@ -207,6 +207,7 @@ versions:
Getting section foo. Getting section foo.
Initializing section foo. Initializing section foo.
Installing recipe spam. Installing recipe spam.
Base installation request: 'spam'
Getting distribution for 'spam'. Getting distribution for 'spam'.
Error: Picked: spam = 2 Error: Picked: spam = 2
... ...
......
...@@ -433,6 +433,9 @@ Now, let's create a buildout that requires y and z: ...@@ -433,6 +433,9 @@ Now, let's create a buildout that requires y and z:
Requirement of sampley: demoneeded==1.0 Requirement of sampley: demoneeded==1.0
While: While:
Installing eggs. Installing eggs.
Base installation request: 'sampley', 'samplez'
Requirement of samplez: demoneeded==1.1
Requirement of sampley: demoneeded==1.0
Error: There is a version conflict. Error: There is a version conflict.
We already have: demoneeded 1.1 We already have: demoneeded 1.1
but sampley 1 requires 'demoneeded==1.0'. but sampley 1 requires 'demoneeded==1.0'.
...@@ -483,6 +486,12 @@ If we use the verbose switch, we can see where requirements are coming from: ...@@ -483,6 +486,12 @@ If we use the verbose switch, we can see where requirements are coming from:
Requirement of sampley: demoneeded==1.0 Requirement of sampley: demoneeded==1.0
While: While:
Installing eggs. Installing eggs.
Base installation request: 'samplea', 'samplez'
Requirement of samplez: demoneeded==1.1
Requirement of samplea: sampleb
Requirement of sampleb: samplea
Requirement of sampleb: sampley
Requirement of sampley: demoneeded==1.0
Error: There is a version conflict. Error: There is a version conflict.
We already have: demoneeded 1.1 We already have: demoneeded 1.1
but sampley 1 requires 'demoneeded==1.0'. but sampley 1 requires 'demoneeded==1.0'.
...@@ -551,6 +560,11 @@ that we can't find. when run in verbose mode ...@@ -551,6 +560,11 @@ that we can't find. when run in verbose mode
... ...
While: While:
Installing eggs. Installing eggs.
Base installation request: 'samplea'
Requirement of samplea: sampleb
Requirement of sampleb: samplea
Requirement of sampleb: sampley
Requirement of sampley: demoneeded
Getting distribution for 'demoneeded'. Getting distribution for 'demoneeded'.
Error: Couldn't find a distribution for 'demoneeded'. Error: Couldn't find a distribution for 'demoneeded'.
""" """
...@@ -2216,6 +2230,28 @@ def dealing_with_extremely_insane_dependencies(): ...@@ -2216,6 +2230,28 @@ def dealing_with_extremely_insane_dependencies():
... ...
While: While:
Installing pack1. Installing pack1.
Base installation request: 'pack0'
Requirement of pack0: pack4
Requirement of pack0: pack3
Requirement of pack0: pack2
Requirement of pack0: pack1
Requirement of pack4: pack5
Requirement of pack4: pack3
Requirement of pack4: pack2
Requirement of pack4: pack1
Requirement of pack4: pack0
Requirement of pack3: pack4
Requirement of pack3: pack2
Requirement of pack3: pack1
Requirement of pack3: pack0
Requirement of pack2: pack4
Requirement of pack2: pack3
Requirement of pack2: pack1
Requirement of pack2: pack0
Requirement of pack1: pack4
Requirement of pack1: pack3
Requirement of pack1: pack2
Requirement of pack1: pack0
Getting distribution for 'pack5'. Getting distribution for 'pack5'.
Error: Couldn't find a distribution for 'pack5'. Error: Couldn't find a distribution for 'pack5'.
...@@ -2257,6 +2293,28 @@ def dealing_with_extremely_insane_dependencies(): ...@@ -2257,6 +2293,28 @@ def dealing_with_extremely_insane_dependencies():
... ...
While: While:
Installing pack1. Installing pack1.
Base installation request: 'pack0'
Requirement of pack0: pack4
Requirement of pack0: pack3
Requirement of pack0: pack2
Requirement of pack0: pack1
Requirement of pack4: pack5
Requirement of pack4: pack3
Requirement of pack4: pack2
Requirement of pack4: pack1
Requirement of pack4: pack0
Requirement of pack3: pack4
Requirement of pack3: pack2
Requirement of pack3: pack1
Requirement of pack3: pack0
Requirement of pack2: pack4
Requirement of pack2: pack3
Requirement of pack2: pack1
Requirement of pack2: pack0
Requirement of pack1: pack4
Requirement of pack1: pack3
Requirement of pack1: pack2
Requirement of pack1: pack0
Getting distribution for 'pack5'. Getting distribution for 'pack5'.
Error: Couldn't find a distribution for 'pack5'. Error: Couldn't find a distribution for 'pack5'.
""" """
...@@ -3301,6 +3359,7 @@ def want_new_zcrecipeegg(): ...@@ -3301,6 +3359,7 @@ def want_new_zcrecipeegg():
Getting section egg. Getting section egg.
Initializing section egg. Initializing section egg.
Installing recipe zc.recipe.egg <2dev. Installing recipe zc.recipe.egg <2dev.
Base installation request: 'zc.recipe.egg <2dev'
Getting distribution for 'zc.recipe.egg<2dev,>=2.0.6'. Getting distribution for 'zc.recipe.egg<2dev,>=2.0.6'.
Error: Couldn't find a distribution for 'zc.recipe.egg<2dev,>=2.0.6'. Error: Couldn't find a distribution for 'zc.recipe.egg<2dev,>=2.0.6'.
""" """
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment