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

RF: revert to default cmp=True for attr.s. Rely on frozen to get hash generated #430

Merged
merged 3 commits into from
Jun 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions reproman/distributions/debian.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@

# TODO: flyweight/singleton ?
# To make them hashable we need to freeze them... not sure if we are ready:
#@attr.s(cmp=True, hash=True, frozen=True)
@attr.s(cmp=True)
#@attr.s(cmp=True, frozen=True)
@attr.s
class APTSource(SpecObject):
"""APT origin information
"""
Expand All @@ -69,7 +69,7 @@ class APTSource(SpecObject):
_register_with_representer(APTSource)


@attr.s(slots=True, frozen=True, cmp=False, hash=True)
@attr.s(slots=True, frozen=True)
class DEBPackage(Package):
"""Debian package information"""
name = attrib(default=attr.NOTHING)
Expand Down
2 changes: 1 addition & 1 deletion reproman/distributions/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from ..utils import attrib


@attr.s(slots=True, frozen=True, cmp=False, hash=True)
@attr.s(slots=True, frozen=True)
class DockerImage(Package):
"""Docker image information"""
id = attrib(default=attr.NOTHING)
Expand Down
2 changes: 1 addition & 1 deletion reproman/distributions/redhat.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class RPMSource(SpecObject):
_register_with_representer(RPMSource)


@attr.s(slots=True, frozen=True, cmp=False, hash=True)
@attr.s(slots=True, frozen=True)
class RPMPackage(Package):
"""Redhat package information"""
name = attrib(default=attr.NOTHING)
Expand Down
2 changes: 1 addition & 1 deletion reproman/distributions/singularity.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from ..utils import attrib, md5sum, chpwd


@attr.s(slots=True, frozen=True, cmp=False, hash=True)
@attr.s(slots=True, frozen=True)
class SingularityImage(Package):
"""Singularity image information"""
md5 = attrib(default=attr.NOTHING)
Expand Down