Skip to content
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

Closed
jnejedly opened this issue Jun 29, 2017 · 5 comments
Closed

Comments

@jnejedly
Copy link

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.

@Emantor
Copy link
Member

Emantor commented Jul 2, 2017

This should be fixed on master with 4309518, are you using the current release or master?
We are aware we currently depend on no longer supported behaviour, but have not discussed or looked into the issue yet.

@jnejedly
Copy link
Author

jnejedly commented Jul 5, 2017

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.

Emantor referenced this issue in Emantor/labgrid Jul 18, 2017
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>
@Emantor Emantor mentioned this issue Jul 18, 2017
3 tasks
Emantor referenced this issue in Emantor/labgrid Jul 18, 2017
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>
Emantor referenced this issue in Emantor/labgrid Jul 18, 2017
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>
Emantor referenced this issue in Emantor/labgrid Jul 21, 2017
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>
@Emantor
Copy link
Member

Emantor commented Jul 26, 2017

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.

Emantor referenced this issue in Emantor/labgrid Jul 29, 2017
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>
Emantor referenced this issue in Emantor/labgrid Aug 1, 2017
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>
@Emantor
Copy link
Member

Emantor commented Aug 1, 2017

I accidently deleted the branch on github, new PR is #116.

@jluebbe jluebbe closed this as completed in 9516871 Aug 1, 2017
@jnejedly
Copy link
Author

jnejedly commented Aug 1, 2017

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants