Skip to content

Commit

Permalink
Merge pull request #430 from yarikoptic/enh-do-not-set-cmp=False
Browse files Browse the repository at this point in the history
RF: revert to default cmp=True for attr.s. Rely on frozen to get hash generated
  • Loading branch information
yarikoptic authored Jun 19, 2019
2 parents fe6f7f9 + fae7a7e commit c291a61
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
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

0 comments on commit c291a61

Please sign in to comment.