Add __hash__ to Link so that Packages correctly hash in resolve.

Review Request #247 — Created April 17, 2014 and submitted

wickman
commons
pants-reviews
jsirois
User reported:
From: Evgeny Sazhin <eugene@sazhin.us>
To: Brian Wickman <wickman@gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

Brian,

As i'm impatiaently waiting for the release of wheel support for Pex i
saw your recent commit and decided to try it out:
When I'm building pex with some wheels as the requirements I'm getting
the following error:

../twitter/common/python/resolver.py, line 32, in has
return package in self._translated_packages

TypeError: unhashable type: WheelPackage

I hope that might be helpful.

thanks,
Eugene

Resolution:
Add __hash__ to Link so that Packages correctly hash in resolve.  Python 3.x does not infer a default __hash__ method on Link and we use it as a key in the distribution cache for resolve().
Doesn't work before.  Works after.
JS
  1. Ship It!
  2. 
      
WI
Review request changed

Status: Closed (submitted)

Loading...