Skip to content

Conversation

@daavoo
Copy link
Contributor

@daavoo daavoo commented Nov 2, 2021

Closes treeverse/dvclive#180

@daavoo daavoo requested a review from a team as a code owner November 2, 2021 12:49
@daavoo daavoo requested a review from karajan1001 November 2, 2021 12:49
@daavoo daavoo self-assigned this Nov 2, 2021
Use `funcy.once_per_args` decorator to prevent opening the html multiple times if user closes first time.

Closes treeverse/dvclive#180
Comment on lines +33 to +38
url = index_path.as_uri()

if "Microsoft" in uname().release:
url = Path(index_path) / "index.html"

webbrowser_open(url)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please move this piece to ui? Maybe as ui.launch (similar to click.launch) or ui.open_browser? We can handle all relpath, uri and WSL stuff inside it. What do you think?

Copy link
Contributor Author

@daavoo daavoo Nov 12, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. Will do

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opened #6993

Copy link
Contributor

@karajan1001 karajan1001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@efiop efiop merged commit 318b269 into master Nov 22, 2021
@efiop efiop deleted the live-open branch November 22, 2021 01:35

def test_dvc_generates_html_during_run(tmp_dir, dvc, mocker, live_stage):
show_spy = mocker.spy(dvc.live, "show")
webbrowser_open = mocker.patch("dvc.repo.live.webbrowser_open")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@daavoo, it seems that the above change affected all of the tests and now opens the browser while running the tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Enhances DVC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dvc: Option to automatically open the html report

4 participants