Skip to content

Commit c291a61

Browse files
authored
Merge pull request #430 from yarikoptic/enh-do-not-set-cmp=False
RF: revert to default cmp=True for attr.s. Rely on frozen to get hash generated
2 parents fe6f7f9 + fae7a7e commit c291a61

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

reproman/distributions/debian.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@
5151

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

7171

72-
@attr.s(slots=True, frozen=True, cmp=False, hash=True)
72+
@attr.s(slots=True, frozen=True)
7373
class DEBPackage(Package):
7474
"""Debian package information"""
7575
name = attrib(default=attr.NOTHING)

reproman/distributions/docker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from ..utils import attrib
2424

2525

26-
@attr.s(slots=True, frozen=True, cmp=False, hash=True)
26+
@attr.s(slots=True, frozen=True)
2727
class DockerImage(Package):
2828
"""Docker image information"""
2929
id = attrib(default=attr.NOTHING)

reproman/distributions/redhat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class RPMSource(SpecObject):
4545
_register_with_representer(RPMSource)
4646

4747

48-
@attr.s(slots=True, frozen=True, cmp=False, hash=True)
48+
@attr.s(slots=True, frozen=True)
4949
class RPMPackage(Package):
5050
"""Redhat package information"""
5151
name = attrib(default=attr.NOTHING)

reproman/distributions/singularity.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
from ..utils import attrib, md5sum, chpwd
2727

2828

29-
@attr.s(slots=True, frozen=True, cmp=False, hash=True)
29+
@attr.s(slots=True, frozen=True)
3030
class SingularityImage(Package):
3131
"""Singularity image information"""
3232
md5 = attrib(default=attr.NOTHING)

0 commit comments

Comments
 (0)