Skip to content

Commit

Permalink
Merge pull request #1702 from consideRatio/pr/fix-ruamel-yaml-syntax-…
Browse files Browse the repository at this point in the history
…issue

maint: fix broken test by upgrading to non-deprecated ruamel.yaml syntax
  • Loading branch information
manics authored May 22, 2023
2 parents 965e2ce + 9bbdc28 commit 7b6d423
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
10 changes: 5 additions & 5 deletions helm-chart/binderhub/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -231,12 +231,12 @@ jupyterhub:
have_lab = major >= 3
if have_lab:
# technically, we could accept another jupyter-server-based frontend
print("Launching jupyter-lab", file=sys.stderr)
exe = "jupyter-lab"
# technically, we could accept another jupyter-server-based frontend
print("Launching jupyter-lab", file=sys.stderr)
exe = "jupyter-lab"
else:
print("jupyter-lab not found, launching jupyter-notebook", file=sys.stderr)
exe = "jupyter-notebook"
print("jupyter-lab not found, launching jupyter-notebook", file=sys.stderr)
exe = "jupyter-notebook"
# launch the notebook server
os.execvp(exe, sys.argv)
Expand Down
8 changes: 5 additions & 3 deletions testing/local-binder-k8s-hub/install-jupyterhub-chart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ import sys
from subprocess import check_call
from tempfile import NamedTemporaryFile

from ruamel import yaml
from ruamel.yaml import YAML

yaml = YAML(typ="safe")

here = os.path.abspath(os.path.dirname(__file__))
helm_chart = os.path.join(here, os.pardir, os.pardir, "helm-chart")
Expand All @@ -24,7 +26,7 @@ def _get_jupyterhub_dependency_version():
chart_yaml = os.path.join(helm_chart, "binderhub", "Chart.yaml")

with open(chart_yaml) as f:
dependecies = yaml.safe_load(f)
dependecies = yaml.load(f)
for dep in dependecies["dependencies"]:
if dep["name"] == "jupyterhub":
return dep["version"]
Expand All @@ -36,7 +38,7 @@ def _get_jupyterhub_dependency_version():

with NamedTemporaryFile(mode="w") as tmp:
with open(os.path.join(helm_chart, "binderhub", "values.yaml")) as values_in:
yaml.safe_dump(yaml.safe_load(values_in)["jupyterhub"], tmp.file)
yaml.dump(yaml.load(values_in)["jupyterhub"], tmp.file)

cmd = ["helm", "upgrade", "--install", "binderhub-test"]
cmd.extend(
Expand Down

0 comments on commit 7b6d423

Please sign in to comment.