Skip to content

Commit

Permalink
Allow fetching from compressed properties files.
Browse files Browse the repository at this point in the history
  • Loading branch information
jendrikseipp committed Nov 19, 2024
1 parent a86c19e commit f62d137
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
12 changes: 12 additions & 0 deletions docs/news.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
Changelog
=========

v8.4 (unreleased)
-----------------

Lab
^^^
* Allow fetching from compressed properties files (Jendrik Seipp).

Downward Lab
^^^^^^^^^^^^
* No changes.


v8.3 (2024-10-22)
-----------------

Expand Down
9 changes: 6 additions & 3 deletions lab/fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,6 @@ def __call__(self, src_dir, eval_dir=None, merge=None, filter=None, **kwargs):
if not src_dir.exists():
logging.critical(f"{src_dir} is missing")

src_props_file = src_dir if src_dir.is_file() else src_dir / "properties"
run_filter = tools.RunFilter(filter, **kwargs)

eval_dir = eval_dir or str(src_dir).rstrip("/") + "-eval"
eval_dir = Path(eval_dir)
logging.info(
Expand All @@ -117,8 +114,14 @@ def __call__(self, src_dir, eval_dir=None, merge=None, filter=None, **kwargs):
tools.remove_path(eval_dir)

# Load properties in the eval_dir if there are any already.
src_props_file = src_dir / "properties"
for path in [src_dir / "properties.xz", src_dir]:
if not src_props_file.is_file() and path.is_file():
src_props_file = path
break
fetch_from_eval_dir = src_props_file.exists()
combined_props = tools.Properties(eval_dir / "properties")
run_filter = tools.RunFilter(filter, **kwargs)
if fetch_from_eval_dir:
src_props = tools.Properties(filename=src_props_file)
if not src_props:
Expand Down

0 comments on commit f62d137

Please sign in to comment.