Skip to content
Snippets Groups Projects
Commit 0299cb4c authored by Jenkins for Software Heritage's avatar Jenkins for Software Heritage
Browse files

Update upstream source from tag 'debian/upstream/0.0.55'

Update to upstream version '0.0.55'
with Debian dir 757a1994777f26411a82369bb5efa044e815d8eb
parents ab310727 679f85b8
No related branches found
Tags v0.3.7
No related merge requests found
Metadata-Version: 2.1 Metadata-Version: 2.1
Name: swh.model Name: swh.model
Version: 0.0.54 Version: 0.0.55
Summary: Software Heritage data model Summary: Software Heritage data model
Home-page: https://forge.softwareheritage.org/diffusion/DMOD/ Home-page: https://forge.softwareheritage.org/diffusion/DMOD/
Author: Software Heritage developers Author: Software Heritage developers
......
Metadata-Version: 2.1 Metadata-Version: 2.1
Name: swh.model Name: swh.model
Version: 0.0.54 Version: 0.0.55
Summary: Software Heritage data model Summary: Software Heritage data model
Home-page: https://forge.softwareheritage.org/diffusion/DMOD/ Home-page: https://forge.softwareheritage.org/diffusion/DMOD/
Author: Software Heritage developers Author: Software Heritage developers
......
...@@ -153,7 +153,7 @@ def skipped_contents(draw): ...@@ -153,7 +153,7 @@ def skipped_contents(draw):
return draw(builds( return draw(builds(
SkippedContent, SkippedContent,
length=optional(integers(min_value=0, max_value=2**63-1)), length=integers(min_value=-1, max_value=2**63-1),
sha1=optional(sha1()), sha1=optional(sha1()),
sha1_git=optional(sha1_git()), sha1_git=optional(sha1_git()),
sha256=optional(binary(min_size=32, max_size=32)), sha256=optional(binary(min_size=32, max_size=32)),
......
...@@ -396,6 +396,7 @@ class Content(BaseContent): ...@@ -396,6 +396,7 @@ class Content(BaseContent):
status = attr.ib( status = attr.ib(
type=str, type=str,
default='visible',
validator=attr.validators.in_(['visible', 'hidden'])) validator=attr.validators.in_(['visible', 'hidden']))
data = attr.ib(type=Optional[bytes], data = attr.ib(type=Optional[bytes],
default=None) default=None)
...@@ -406,7 +407,7 @@ class Content(BaseContent): ...@@ -406,7 +407,7 @@ class Content(BaseContent):
@length.validator @length.validator
def check_length(self, attribute, value): def check_length(self, attribute, value):
"""Checks the length is positive.""" """Checks the length is positive."""
if self.status != 'absent' and value < 0: if value < 0:
raise ValueError('Length must be positive.') raise ValueError('Length must be positive.')
def to_dict(self): def to_dict(self):
...@@ -427,7 +428,7 @@ class SkippedContent(BaseContent): ...@@ -427,7 +428,7 @@ class SkippedContent(BaseContent):
sha256 = attr.ib(type=Optional[bytes]) sha256 = attr.ib(type=Optional[bytes])
blake2s256 = attr.ib(type=Optional[bytes]) blake2s256 = attr.ib(type=Optional[bytes])
length = attr.ib(type=Optional[int]) length = attr.ib(type=int)
status = attr.ib( status = attr.ib(
type=str, type=str,
...@@ -451,7 +452,7 @@ class SkippedContent(BaseContent): ...@@ -451,7 +452,7 @@ class SkippedContent(BaseContent):
@length.validator @length.validator
def check_length(self, attribute, value): def check_length(self, attribute, value):
"""Checks the length is positive or -1.""" """Checks the length is positive or -1."""
if value is not None and value < -1: if value < -1:
raise ValueError('Length must be positive or -1.') raise ValueError('Length must be positive or -1.')
def to_dict(self): def to_dict(self):
......
v0.0.54-0-g8ebbd21 v0.0.55-0-g73053a6
\ No newline at end of file \ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment