Skip to content

Commit 1d0cb78

Browse files
committed
finish Hypha upload
1 parent 7247fc5 commit 1d0cb78

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

bioimageio/spec/_upload.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,24 @@
1818
from ._internal.io import BioimageioYamlContent, get_reader
1919
from ._internal.io_basics import BIOIMAGEIO_YAML
2020
from ._internal.io_utils import write_yaml
21+
from ._internal.validation_context import get_validation_context
2122
from ._package import get_resource_package_content
22-
from .common import PermissiveFileSource
23+
from .common import HttpUrl, PermissiveFileSource
2324

2425

2526
def upload(
2627
source: Union[PermissiveFileSource, ZipFile, ResourceDescr, BioimageioYamlContent],
2728
/,
28-
) -> Union[ResourceDescr, InvalidDescr]:
29+
) -> HttpUrl:
2930
"""Upload a new resource description (version) to the hypha server to be shared at bioimage.io.
3031
To edit an existing resource **version**, please login to https://bioimage.io and use the web interface.
3132
3233
Args:
3334
source: The resource description to upload.
3435
3536
Returns:
36-
The uploaded resource description.
37+
A URL to the uploaded resource description.
38+
Note: It might take some time until the resource is processed and available for download from the returned URL.
3739
"""
3840

3941
if settings.hypha_upload_token is None:
@@ -152,7 +154,10 @@ def upload(
152154
logger.info(
153155
"Updated status of {}/{} to 'request-review'", artifact_id, artifact_version
154156
)
155-
156-
return load_description(
157-
f"https://hypha.aicell.io/bioimage-io/artifacts/{artifact_id}/files/rdf.yaml?version={artifact_version}"
157+
logger.warning(
158+
"Upload successfull. Please note that the uploaded resource might not be available for download immediately."
158159
)
160+
with get_validation_context().replace(perform_io_checks=False):
161+
return HttpUrl(
162+
f"https://hypha.aicell.io/bioimage-io/artifacts/{artifact_id}/files/rdf.yaml?version={artifact_version}"
163+
)

0 commit comments

Comments
 (0)