From 3a4cecafe05b191edf011fd529e57cd0562d0ff9 Mon Sep 17 00:00:00 2001 From: YuviPanda Date: Mon, 28 Oct 2024 21:15:44 -0700 Subject: [PATCH] Revert "More clearly specify how we look for v6 notebook packages" This commit caused the *notebook* downstream version check to fail, which makes sense? This reverts commit 40029a7f0698fabf2692ebe2a5857473dcb76909. --- jupyter_server/prometheus/metrics.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/jupyter_server/prometheus/metrics.py b/jupyter_server/prometheus/metrics.py index 77dce9e54..2af756e99 100644 --- a/jupyter_server/prometheus/metrics.py +++ b/jupyter_server/prometheus/metrics.py @@ -10,16 +10,13 @@ try: from notebook._version import version_info as notebook_version_info - v6_notebook_present = notebook_version_info != server_version_info except ImportError: - # notebook._version is not present, so notebook v6 can not be present - v6_notebook_present = False + notebook_version_info = None -if v6_notebook_present: +if notebook_version_info is not None and notebook_version_info < (7,) and notebook_version_info != server_version_info: print("yes, we think we have an unshimmed notebook package") print(notebook_version_info) - print(server_version_info) # Jupyter Notebook v6 also defined these metrics. Re-defining them results in a ValueError, # so we simply re-export them if we are co-existing with the notebook v6 package. # See https://github.com/jupyter/jupyter_server/issues/209