Skip to content

Commit

Permalink
Merge pull request #97 from bioimage-io/avoid_micromamba_post_error
Browse files Browse the repository at this point in the history
add generate-run-shell: false to avoid error annotations
  • Loading branch information
FynnBe authored Sep 26, 2024
2 parents 6fa6ae3 + 081d34f commit acb9766
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 11 deletions.
1 change: 1 addition & 0 deletions .github/workflows/check_compatibility_ilastik.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ jobs:
- name: Setup ilastik env
uses: mamba-org/setup-micromamba@v1
with:
generate-run-shell: false
environment-file: env.yaml
cache-downloads: true
cache-environment: true
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test_call.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ jobs:
id: create_env
uses: mamba-org/setup-micromamba@v1
with:
generate-run-shell: false
cache-downloads: true
environment-name: ${{ matrix.weight_format }}
environment-file: ${{inputs.environment_name}}_${{inputs.concept_id}}_${{inputs.version}}_conda_env_${{matrix.weight_format}}.yaml
Expand Down
6 changes: 4 additions & 2 deletions bioimageio_collection_backoffice/_thumbnails.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ def create_thumbnails(
covers: Union[Any, List[Any]] = rdf.get("covers")
plan: List[Tuple[Any, Tuple[int, int]]] = []
if isinstance(covers, list):
plan.extend((src, (600, 340)) for src in covers)
covers_list: List[Any] = covers
plan.extend((src, (600, 340)) for src in covers_list)

badges: Union[Any, List[Any]] = rdf.get("badges")
if isinstance(badges, list):
for badge in badges:
badges_list: List[Any] = badges
for badge in badges_list:
if not isinstance(badge, dict):
continue

Expand Down
22 changes: 13 additions & 9 deletions bioimageio_collection_backoffice/remote_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,9 +506,7 @@ def generate_collection_json(
def get_collection_json(self) -> CollectionJson:
data = self.client.load_file("collection.json")
assert data is not None
collection: Union[Any, Dict[str, Union[Any, List[Dict[str, Any]]]]] = (
json.loads(data)
)
collection: Dict[str, List[Dict[str, Any]]] = json.loads(data)
assert isinstance(
collection, dict
) # TODO: create typed dict for collection.json
Expand Down Expand Up @@ -750,7 +748,7 @@ def unpack(self, package_url: str):
file_names = set(zipobj.namelist())
bioimageio_yaml_file_name = identify_bioimageio_yaml_file_name(file_names)

rdf: Union[Any, Dict[Any, Any]] = yaml.load(
rdf: Dict[Any, Any] = yaml.load(
zipobj.open(bioimageio_yaml_file_name).read().decode()
)
if not isinstance(rdf, dict):
Expand Down Expand Up @@ -919,7 +917,7 @@ def publish(self, reviewer: str) -> Record:
if rdf_data is None:
raise RuntimeError(f"Failed to load staged RDF from {self.rdf_path}")

rdf: Union[Any, Dict[Any, Any]] = yaml.load(rdf_data.decode())
rdf: Dict[Any, Any] = yaml.load(rdf_data.decode())
assert isinstance(rdf, dict)
version = rdf.get("version", "1")
if not isinstance(version, (int, float, str)):
Expand Down Expand Up @@ -1038,10 +1036,14 @@ def maybe_swap_with_thumbnail(
src: Union[Any, Dict[Any, Any], List[Any]], thumbnails: Mapping[str, str]
) -> Any:
if isinstance(src, dict):
return {k: maybe_swap_with_thumbnail(v, thumbnails) for k, v in src.items()}
src_dict: Dict[Any, Any] = src
return {
k: maybe_swap_with_thumbnail(v, thumbnails) for k, v in src_dict.items()
}

if isinstance(src, list):
return [maybe_swap_with_thumbnail(s, thumbnails) for s in src]
src_list: List[Any] = src
return [maybe_swap_with_thumbnail(s, thumbnails) for s in src_list]

if isinstance(src, str) and not src.startswith("https://"):
clean_name = Path(src).name # remove any leading './'
Expand All @@ -1057,10 +1059,12 @@ def resolve_relative_path(
src: Union[Any, Dict[Any, Any], List[Any]], parsed_root: SplitResult
) -> Any:
if isinstance(src, dict):
return {k: resolve_relative_path(v, parsed_root) for k, v in src.items()}
src_dict: Dict[Any, Any] = src
return {k: resolve_relative_path(v, parsed_root) for k, v in src_dict.items()}

if isinstance(src, list):
return [resolve_relative_path(s, parsed_root) for s in src]
src_list: List[Any] = src
return [resolve_relative_path(s, parsed_root) for s in src_list]

if isinstance(src, str):
if src.startswith("http") or src.startswith("/") or "." not in src:
Expand Down

0 comments on commit acb9766

Please sign in to comment.