devbox icon indicating copy to clipboard operation
devbox copied to clipboard

Hide banner message from python plugin

Open kadaan opened this issue 1 year ago • 6 comments

What problem are you trying to solve?

The python plugin logs a banner message no matter what.. https://github.com/jetpack-io/devbox/blob/7f1633f6834f8772d31b06588c637b8f12cbe7c7/plugins/pip/venvShellHook.sh#L8

If you use the shell init_hook to enter the virtual env it would be nice to suppress this message. This is especially important when scripts are execute via devbox run ..., because the message ends up just being cruft.

What solution would you like?

Create a environment variable set automatically by devbox: DEVBOX_ENTRYPOINT=run:<script_name> or DEVBOX_ENTRYPOINT=shell. Then the python plugin could not print the banner if DEVBOX_ENTRYPOINT=run:*. This would solve the run case.

Optionally, change the python plugin to not log the banner if a specific environment variable is present (ie. DEVBOX_PLYTHON_PLUGIN_HIDE_BANNER

Alternatives you've considered

Writing a wrapper around devbox would be another way to solve this, but that seems like more maintenance in the long run.

kadaan avatar Feb 21 '24 00:02 kadaan