mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
Feature/hydra config modules (#9783)
* hydra: enable config modules Lets the user specify Hydra configs in installed Python modules as well as inside directories. Adds `hydra.config_module` to `.dvc/config`. Fixes #9740 old tests green tests for config modules * hydra: fix linter errors * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * hydra: fix mypy error * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * hydra: fix tests * Update dvc/utils/hydra.py Co-authored-by: David de la Iglesia Castro <[email protected]> * address comments * convince mypy not to worry * split long line * fix test * check for raised error in test --------- Co-authored-by: Dom Miketa <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: David de la Iglesia Castro <[email protected]>
This commit is contained in:
co-authored by
David de la Iglesia Castro
Dom Miketa
pre-commit-ci[bot]
parent
43b371c43a
commit
009b238807
@@ -476,13 +476,17 @@ class BaseStashQueue(ABC):
|
||||
hydra_output_file = ParamsDependency.DEFAULT_PARAMS_FILE
|
||||
for path, overrides in params.items():
|
||||
if hydra_enabled and path == hydra_output_file:
|
||||
config_dir = os.path.join(
|
||||
self.repo.root_dir, hydra_config.get("config_dir", "conf")
|
||||
)
|
||||
if (config_module := hydra_config.get("config_module")) is None:
|
||||
config_dir = os.path.join(
|
||||
self.repo.root_dir, hydra_config.get("config_dir", "conf")
|
||||
)
|
||||
else:
|
||||
config_dir = None
|
||||
config_name = hydra_config.get("config_name", "config")
|
||||
compose_and_dump(
|
||||
path,
|
||||
config_dir,
|
||||
config_module,
|
||||
config_name,
|
||||
overrides,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user