-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labgrid driver/resource binding does not work with new attrs behavior #106
Comments
This should be fixed on master with 4309518, are you using the current release or master? |
I was using v0.1.0, but when I was looking into this issue I saw that the master branch had the older attrs version specified. I just wanted to make sure you were aware which change in attrs caused the issue, so it could be fixed in a future release. |
We don't need the compare functionality of attrs. Disable it to fall back to object id hashes. Fixes #106 Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
We don't need the compare functionality of attrs. Disable it to fall back to object id hashes. Fixes #106 Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
We don't need the compare functionality of attrs. Disable it to fall back to object id hashes. Fixes #106 Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
We mostly don't need the compare functionality of attrs. Disable it to fall back to object id hashes (similar to python standard classes). The only exception is the ResourceMatch class, since we collect these into a list and need to remove them later on. The list remove function requires the implementation of the compare functions, explicitly enable it for the ResourceMatch class. Fixes #106 Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
I posted a WIP branch #113, I would highly appreciate it if you could test labgrid with this branch applied. We are rolling the branch out for internal testing as well. |
We mostly don't need the compare functionality of attrs. Disable it to fall back to object id hashes (similar to python standard classes). The only exception is the ResourceMatch class, since we collect these into a list and need to remove them later on. The list remove function requires the implementation of the compare functions, explicitly enable it for the ResourceMatch class. Fixes #106 Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
We mostly don't need the compare functionality of attrs. Disable it to fall back to object id hashes (similar to python standard classes). The only exception is the ResourceMatch class, since we collect these into a list and need to remove them later on. The list remove function requires the implementation of the compare functions, explicitly enable it for the ResourceMatch class. Fixes #106 Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
I accidently deleted the branch on github, new PR is #116. |
Sorry, I meant to test this out. Looks like you were already able to internally test the changes, but I did just test them myself and it seems like it fixes the issue. Thanks! |
Labgrid is not compatible with the most recent version of attrs due to a change to the default hashing behavior (unhashable). See here: python-attrs/attrs#136
The BindingMixin class defines suppliers and clients as sets, which cannot contain unhashable objects. I think the fix would be to either change all drivers/resources to use the @attr.s(cmp=False) option to disable generation of comparison methods and make the objects hashable, or change the way that the BindingMixin registers suppliers and clients.
The text was updated successfully, but these errors were encountered: