mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-10 07:18:27 +01:00
Fix dvclive running subdir (#6740)
* Fix dvclive running subdir * Apply suggestions from code review Co-authored-by: Saugat Pachhai <[email protected]> * Applied suggestions * Update tests/func/test_live.py Co-authored-by: Saugat Pachhai <[email protected]>
This commit is contained in:
co-authored by
Saugat Pachhai
parent
0eda4bd91c
commit
16f404b16a
@@ -273,7 +273,7 @@ class Stage(params.StageParams):
|
||||
from dvc.output import Output
|
||||
from dvc.schema import LIVE_PROPS
|
||||
|
||||
env[DVCLIVE_PATH] = str(out.path_info)
|
||||
env[DVCLIVE_PATH] = relpath(out.path_info, self.wdir)
|
||||
if isinstance(out.live, dict):
|
||||
config = project(out.live, LIVE_PROPS)
|
||||
|
||||
|
||||
@@ -255,3 +255,22 @@ def test_dvc_generates_html_during_run(tmp_dir, dvc, mocker, live_stage):
|
||||
live_stage(summary=True, live="logs", code=script)
|
||||
|
||||
assert show_spy.call_count == 2
|
||||
|
||||
|
||||
def test_dvclive_stage_with_different_wdir(tmp_dir, scm, dvc):
|
||||
(tmp_dir / "subdir").gen("train.py", LIVE_SCRIPT)
|
||||
(tmp_dir / "subdir" / "params.yaml").dump({"foo": 1})
|
||||
dvc.stage.add(
|
||||
cmd="python train.py",
|
||||
params=["foo"],
|
||||
deps=["train.py"],
|
||||
name="live_stage",
|
||||
live="dvclive",
|
||||
live_no_html=True,
|
||||
wdir="subdir",
|
||||
)
|
||||
|
||||
dvc.reproduce()
|
||||
|
||||
assert (tmp_dir / "subdir" / "dvclive").is_dir()
|
||||
assert (tmp_dir / "subdir" / "dvclive.json").is_file()
|
||||
|
||||
Reference in New Issue
Block a user