Skip to content

live: Handle auto_open via env.#243

Merged
daavoo merged 1 commit into
mainfrom
env-open
Apr 26, 2022
Merged

live: Handle auto_open via env.#243
daavoo merged 1 commit into
mainfrom
env-open

Conversation

@daavoo
Copy link
Copy Markdown
Contributor

@daavoo daavoo commented Apr 20, 2022

Remove auto_open arg.
Add DVCLIVE_OPEN env var.
Add env2bool utils.

Closes #241

@daavoo daavoo requested review from dberenbaum and pared April 20, 2022 10:19
Comment thread tests/test_report.py Outdated
Comment thread dvclive/env.py Outdated
Comment thread dvclive/live.py Outdated
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

What should the default be? Should we try to detect tty if no environment variable is set? Are there ever cases where the report was auto opened by default before?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

What should the default be?

It's currently False and I guess that's what should be

Should we try to detect tty if no environment variable is set?

I'm not sure if it's worth the effort. We provide a way for users to handle the option in different environments, let's be explicit in docs about how to use it.

Are there ever cases where the report was auto opened by default before?

Only if dvc config plots.auto_open was set to True.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

My worry is that the point of auto open is to make the simplest use case (showing the live report) as easy as possible, and this creates an additional step. It almost seems pointless to have the environment variable, since it's mostly for people who don't read the docs or can't immediately figure out how to open the report.

Maybe it's not really an issue. I think it's fine to merge, but I'm curious about whether auto open is ever needed and if there's some way to make this scenario useful.

Copy link
Copy Markdown
Contributor Author

@daavoo daavoo Apr 26, 2022

Choose a reason for hiding this comment

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

Good points.

If I remember correctly, requests for making it default False were coming from Vscode, not users.

Perhaps it makes sense to default to True, as we provide a way for external products (and users) to override the default behavior.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@mattseddon Would it be okay for you if we make the default True? vscode would need to always set the DVCLIVE_OPEN var in order to prevent the behavior

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

It might be enough to hint about the environment variable like in https://github.com/iterative/dvc/blob/f84f9cf1846554a13f388693220378edb8d17be6/dvc/commands/plots.py#L111.

@daavoo What do you think about this idea?

Remove `auto_open` arg.
Add DVCLIVE_OPEN env var.
Add env2bool utils.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

auto_open: how to handle it

3 participants