[hg] galaxy 1726: More fixes to eggs.require()
details: http://www.bx.psu.edu/hg/galaxy/rev/9a06f9910524 changeset: 1726:9a06f9910524 user: Nate Coraor <nate@bx.psu.edu> date: Tue Jan 27 17:12:04 2009 -0500 description: More fixes to eggs.require() 1 file(s) affected in this change: lib/galaxy/eggs/__init__.py diffs (35 lines): diff -r 7411b119a3c9 -r 9a06f9910524 lib/galaxy/eggs/__init__.py --- a/lib/galaxy/eggs/__init__.py Tue Jan 27 16:17:22 2009 -0500 +++ b/lib/galaxy/eggs/__init__.py Tue Jan 27 17:12:04 2009 -0500 @@ -527,7 +527,6 @@ pkg_resources.working_set.require( pkg ) else: pkg_resources.working_set.require( "%s==%s" % ( name, egg.get_vertag() ) ) - return except pkg_resources.VersionConflict, e: # there's a conflicting egg on the pythonpath, remove it dist = e.args[0] @@ -539,10 +538,13 @@ working_set.entries.remove( entry ) break else: - raise # some path weirdness has prevented us from finding the offender + location = None del working_set.by_key[dist.key] working_set.entry_keys[entry] = [] sys.path.remove(entry) + require( pkg ) + if location is not None and not location.endswith( '.egg' ): + working_set.entries.append( location ) # re-add to the set if it's a dir. except pkg_resources.DistributionNotFound, e: # the initial require itself is the first dep, but it can have # multiple deps, which will be fetched by the require below. @@ -555,7 +557,7 @@ if not egg.have: if not egg.fetch(): raise EggNotFetchable( egg.name ) - require( pkg ) + require( pkg ) # convenience stuff def get_ucs():
participants (1)
-
Nate Coraor