Skip to content

Commit 9128c85

Browse files
committed
skip redundant testing and Merge pull request #715 from bioimage-io/dev
fix packaging to same folder and improve logging
2 parents 35c5970 + 7b8bdf0 commit 9128c85

File tree

6 files changed

+37
-7
lines changed

6 files changed

+37
-7
lines changed

.github/workflows/build.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,6 @@ jobs:
188188
pip --version
189189
pip install --upgrade build
190190
pip install .
191-
pip install pytest
192-
- name: Test with pytest
193-
run: pytest --disable-pytest-warnings
194-
- name: Check version submodule imports
195-
run: python scripts/generate_version_submodule_imports.py check
196191
- name: Check if there is a parent commit
197192
id: check-parent-commit
198193
run: |

bioimageio/spec/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
"""
22
.. include:: ../../README.md
33
"""
4+
# ruff: noqa: E402
45

5-
__version__ = "0.5.5.0"
6+
__version__ = "0.5.5.1"
7+
from loguru import logger
68

9+
logger.disable("bioimageio.spec")
710

811
from . import (
912
application,

bioimageio/spec/_internal/_settings.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
from .root_url import RootHttpUrl
1414

1515

16-
class Settings(BaseSettings, extra="ignore"):
16+
class Settings(
17+
BaseSettings, extra="ignore", allow_inf_nan=False, validate_assignment=True
18+
):
1719
"""environment variables for bioimageio.spec"""
1820

1921
model_config = SettingsConfigDict(

bioimageio/spec/_internal/io_utils.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,16 @@ def write_content_to_zip(
287287
else:
288288
reader = get_reader(file)
289289

290+
if (
291+
isinstance(reader.original_root, ZipFile)
292+
and reader.original_root.filename == zip.filename
293+
and reader.original_file_name == arc_name
294+
):
295+
logger.debug(
296+
f"Not copying {reader.original_root}/{reader.original_file_name} to itself."
297+
)
298+
continue
299+
290300
with zip.open(arc_name, "w") as dest:
291301
shutil.copyfileobj(reader, dest, 1024 * 8)
292302

bioimageio/spec/_package.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,23 @@ def save_bioimageio_package_as_folder(
188188
for name, src in package_content.items():
189189
if isinstance(src, collections.abc.Mapping):
190190
write_yaml(src, output_path / name)
191+
elif (
192+
isinstance(src.original_root, Path)
193+
and src.original_root / src.original_file_name
194+
== (output_path / name).resolve()
195+
):
196+
logger.debug(
197+
f"Not copying {src.original_root / src.original_file_name} to itself."
198+
)
191199
else:
200+
if isinstance(src.original_root, Path):
201+
logger.debug(
202+
f"Copying from path {src.original_root / src.original_file_name} to {output_path / name}."
203+
)
204+
else:
205+
logger.debug(
206+
f"Copying {src.original_root}/{src.original_file_name} to {output_path / name}."
207+
)
192208
with (output_path / name).open("wb") as dest:
193209
_ = shutil.copyfileobj(src, dest)
194210

changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ In this file we log both:
1010

1111
This changelog includes implementation details and my reference the [changes to the Resource Description Format](#changes-to-the-resource-description-format), e.g. in entry [bioimageio.spec 0.5.2](#bioimageiospec-052).
1212

13+
#### bioimageio.spec 0.5.5.1
14+
15+
- fix package export to the same directory as model source (avoid 'deleting' files by overwriting them in-place)
16+
1317
#### bioimageio.spec 0.5.5.0
1418

1519
- added programmatic `uplaod` (alpha stage)

0 commit comments

Comments
 (0)