diff --git a/backoffice/utils/remote_resource.py b/backoffice/utils/remote_resource.py index 594ad99c..cd162989 100644 --- a/backoffice/utils/remote_resource.py +++ b/backoffice/utils/remote_resource.py @@ -253,7 +253,7 @@ def publish(self) -> PublishedVersion: else: next_version = max(map(int, versions)) + 1 - logger.debug("Publishing {} as version {}", self.folder, next_version) + logger.debug("Publishing {} as version nr {}", self.folder, next_version) assert next_version not in versions, (next_version, versions) @@ -262,7 +262,7 @@ def publish(self) -> PublishedVersion: rdf_data = self.client.load_file(staged_rdf_path) rdf = yaml.load(rdf_data) - sem_ver = rdf.get("sem_ver") + sem_ver = rdf.get("version") if sem_ver is not None and sem_ver in {v["sem_ver"] for v in versions.values()}: raise RuntimeError(f"Trying to publish {sem_ver} again!") diff --git a/backoffice/utils/s3_structure.py b/backoffice/utils/s3_structure.py index 0d33672a..358c22fd 100644 --- a/backoffice/utils/s3_structure.py +++ b/backoffice/utils/s3_structure.py @@ -12,7 +12,10 @@ class VersionDetails(TypedDict): sem_ver: Optional[str] -Versions = dict[int, VersionDetails] +VersionNr = int +"""the n-th published version""" + +Versions = dict[VersionNr, VersionDetails] """info about published resource versions at `/versions.json`""" LogCategory = Literal[ diff --git a/backoffice/validate_format.py b/backoffice/validate_format.py index a3e686ee..92758497 100644 --- a/backoffice/validate_format.py +++ b/backoffice/validate_format.py @@ -233,12 +233,12 @@ def validate_format(staged: StagedVersion): rd = rd_latest rd.validation_summary.status = "passed" # passed in 'discover' mode - if not isinstance(rd, InvalidDescr) and rd.sem_ver is not None: + if not isinstance(rd, InvalidDescr) and rd.version is not None: published = staged.get_published_versions() - if str(rd.sem_ver) in {v["sem_ver"] for v in published.values()}: + if str(rd.version) in {v["sem_ver"] for v in published.values()}: error = ErrorEntry( - loc=("sem_ver",), - msg=f"Trying to publish semantic version {rd.sem_ver} again!", + loc=("version",), + msg=f"Trying to publish version {rd.version} again!", type="error", ) else: @@ -246,7 +246,7 @@ def validate_format(staged: StagedVersion): rd.validation_summary.add_detail( ValidationDetail( - name="Enforce that RDF has unpublished semantic version (field `sem_ver`)", + name="Enforce that RDF has unpublished semantic `version`", status="passed" if error is None else "failed", errors=[] if error is None else [error], ) diff --git a/setup.py b/setup.py index c6cb11e3..9355b89a 100644 --- a/setup.py +++ b/setup.py @@ -31,8 +31,8 @@ ], packages=find_packages(exclude=["tests"]), install_requires=[ - "bioimageio.core @ git+https://github.com/bioimage-io/core-bioimage-io-python@40aae1005e6caea4a3ad6104f54deba8582d0f87", # TODO: change to released version - "bioimageio.spec @ git+https://github.com/bioimage-io/spec-bioimage-io@b9714ba8d8214c67e9377a8cd24f6ba65ed1b981", # TODO: change to released version + "bioimageio.core @ git+https://github.com/bioimage-io/core-bioimage-io-python@569666b426cb089503f2ee3bb5651e124d8740e8", # TODO: change to released version + "bioimageio.spec @ git+https://github.com/bioimage-io/spec-bioimage-io@06e6b0f77c696e7c5192fa1340482f97b2df98fc", # TODO: change to released version "fire", "loguru", "minio==7.2.4",