Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add environment variable at startup #123

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft

Add environment variable at startup #123

wants to merge 7 commits into from

Conversation

hoxbro
Copy link
Member

@hoxbro hoxbro commented Jun 24, 2024

This way, we can check in a notebook if the environment variable is set and give a warning if it is not.

image

Also available in the jupyter terminal.
image

import os

os.environ.get("_PYVIZ_COMMS_INSTALLED")

@hoxbro hoxbro marked this pull request as draft June 24, 2024 16:24
@@ -30,6 +30,10 @@ def _jupyter_labextension_paths():
except NameError:
get_ipython = None

# Setting this so we can check the launched jupyter has pyviz_comms installed
if not (get_ipython and sys.argv[0].endswith('ipykernel_launcher.py')):
Copy link
Member Author

Choose a reason for hiding this comment

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

ipykernel_launcher.py file is what launches a notebook.

I will update the comments if we decide to proceed with the PR.

The name of the environment variable can change maybe to PYVIZ_COMMS_INSTALLED.

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.

1 participant