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

Merged
merged 7 commits into from
Nov 12, 2024
Merged

Add environment variable at startup #123

merged 7 commits into from
Nov 12, 2024

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.

Copy link
Member

@philippjfr philippjfr left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@hoxbro hoxbro marked this pull request as ready for review November 12, 2024 16:20
@hoxbro hoxbro merged commit 6301780 into main Nov 12, 2024
8 checks passed
@hoxbro hoxbro deleted the add_env_variable branch November 12, 2024 16:35
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.

2 participants