Skip to content

Commit

Permalink
jupyter, cache - Respect JUPYTERCACHE environment variable
Browse files Browse the repository at this point in the history
This variable is used to modified default cache in jupyter-cache https://jupyter-cache.readthedocs.io/en/latest/using/cli.html
  • Loading branch information
cderv committed Feb 19, 2025
1 parent 83c472c commit ffb8c3d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/resources/jupyter/notebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ def retrieve_nb_from_cache(nb, status, input, **kwargs):
if not get_cache:
raise ImportError('The jupyter-cache package is required for cached execution')
trace('getting cache')
nb_cache = get_cache(".jupyter_cache")
# Respect env var used to modify default cache dir
# https://jupyter-cache.readthedocs.io/en/latest/using/cli.html
nb_cache = get_cache(os.getenv('JUPYTERCACHE', '.jupyter_cache'))
if not cache == "refresh":
cached_nb = nb_from_cache(nb, nb_cache)
if cached_nb:
Expand Down

0 comments on commit ffb8c3d

Please sign in to comment.