Skip to content

Commit

Permalink
Merge pull request #608 from bioimage-io/fix_sha
Browse files Browse the repository at this point in the history
Fix sha issues for versioned RDFs
  • Loading branch information
FynnBe authored Jun 11, 2024
2 parents b09e343 + 6e316ac commit f856c88
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ Made with [contrib.rocks](https://contrib.rocks).

### bioimageio.spec Python package

#### bioimageio.spec 0.5.3post2

* fix SHA-256 value when resolving a RDF version from the bioimage.io collection that is not the latest

#### bioimageio.spec 0.5.3post1

* bump patch version during loading for model 0.5.x
Expand Down
2 changes: 1 addition & 1 deletion bioimageio/spec/VERSION
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "0.5.3post1"
"version": "0.5.3post2"
}
17 changes: 13 additions & 4 deletions bioimageio/spec/_internal/io_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,18 +181,27 @@ def _get_one_collection(url: str):
for raw_entry in collection:
assert isinstance(raw_entry, dict), type(raw_entry)
v: Any
sha: Any
d: Any
try:
for i, (v, d) in enumerate(zip(raw_entry["versions"], raw_entry["dois"])):
for i, (v, sha, d) in enumerate(
zip(
raw_entry["versions"],
raw_entry["versions_sha256"],
raw_entry["dois"],
)
):
entry = CollectionEntry(
id=raw_entry["id"],
emoji=raw_entry.get("id_emoji", raw_entry.get("nickname_icon", "")),
url=raw_entry["rdf_source"],
sha256=raw_entry["rdf_sha256"],
url=raw_entry["rdf_source"].replace(
f"/{raw_entry['versions'][0]}/", f"/{v}/"
),
sha256=sha,
version=v,
doi=d,
)
ret[f"{raw_entry['id']}/{v}"] = entry
ret[v] = entry
if i == 0:
# latest version
ret[raw_entry["id"]] = entry
Expand Down

0 comments on commit f856c88

Please sign in to comment.