Skip to content

Commit

Permalink
Merge pull request #554 from mit-ll-responsible-ai/fix-ci
Browse files Browse the repository at this point in the history
CI compatibility with cloudpickle 3.0.0
  • Loading branch information
rsokl authored Oct 19, 2023
2 parents d56abd1 + 2d298bb commit 2674fd5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/hydra_zen/_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ def launch(
job = sweeper.sweep(arguments=task_overrides)
callbacks.on_multirun_end(config=cfg, config_name=config_name)

if is_dataclass(config):
if is_dataclass(config): # pragma: no cover
_num_dataclass_fields_after = len(fields(config))
if (
_num_dataclass_fields_after == 0
Expand Down
5 changes: 2 additions & 3 deletions tests/test_launch/test_implementations.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Copyright (c) 2023 Massachusetts Institute of Technology
# SPDX-License-Identifier: MIT

import dataclasses
from pathlib import Path
from typing import Optional

Expand All @@ -15,8 +16,6 @@
from hydra_zen._launch import _store_config

try:
import dataclasses

import cloudpickle

CLOUDPICKLE_AVAIL = True
Expand Down Expand Up @@ -74,7 +73,7 @@ def task_fn(cfg):
launch(cfg, task_function=task_fn, to_dictconfig=to_dictconfig, **version_base)

if pre_num_fields > 0:
if not to_dictconfig:
if not to_dictconfig and int(cloudpickle.__version__.split(".")[0]) < 3:
assert len(dataclasses.fields(cfg)) == 0
else:
assert len(dataclasses.fields(cfg)) > 0
Expand Down

0 comments on commit 2674fd5

Please sign in to comment.