Skip to content

Commit

Permalink
Fix gateway kernelspec tests to updated JKM call
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin-bates committed Nov 20, 2019
1 parent a2ab44e commit f3ecf87
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
13 changes: 10 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
# miniconda bootstrap from conda-forge recipe
matrix:
fast_finish: true
fast_finish: false

environment:
matrix:
- CONDA_PY: 38
CONDA_PY_SPEC: ">=3.8,<3.9.0a0"
CONDA_INSTALL_LOCN: "C:\\Miniconda36-x64"
- CONDA_PY: 37
CONDA_PY_SPEC: ">=3.7,<3.8.0a0"
CONDA_INSTALL_LOCN: "C:\\Miniconda36-x64"


platform:
- x64

Expand All @@ -18,9 +23,11 @@ install:
- cmd: conda config --add channels conda-forge
#- cmd: conda update --yes --quiet conda
#- cmd: conda install -y pyzmq tornado jupyter_kernel_mgmt nbformat nbconvert ipykernel pip nose
- cmd: conda install -y pyzmq tornado jupyter_client nbformat nbconvert ipykernel pip nose
- cmd: conda install -y python=%CONDA_PY_SPEC% pyzmq tornado jupyter_client nbformat nbconvert ipykernel pip nose
- cmd: pip install .[test]
- cmd: pip install git+https://github.com/gateway-experiments/jupyter_kernel_mgmt.git@fix-windows

test_script:
- nosetests -v jupyter_server --exclude-dir notebook\tests\selenium
- nosetests -v jupyter_server.services.kernels.tests
- nosetests -v jupyter_server.tests.test_utils
#- nosetests -v jupyter_server --exclude-dir notebook\tests\selenium
13 changes: 6 additions & 7 deletions jupyter_server/gateway/managers.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.

import asyncio
import os
import json
import logging

from jupyter_kernel_mgmt.discovery import KernelFinder
from socket import gaierror
from tornado import gen, web
from tornado.concurrent import Future
from tornado.escape import json_encode, json_decode, url_escape
from tornado.httpclient import HTTPClient, AsyncHTTPClient, HTTPError

Expand Down Expand Up @@ -519,15 +520,13 @@ def _get_kernelspecs_endpoint_url(self, kernel_name=None):

return self.base_endpoint

@gen.coroutine
@asyncio.coroutine
def find_kernels(self):
remote_kspecs_list = []
remote_kspecs = yield maybe_future(self.get_all_specs())
remote_kspecs = yield from self.get_all_specs()

# convert to list of 2 tuples
for kernel_type, attributes in remote_kspecs.items():
remote_kspecs_list.append((kernel_type, attributes))

raise gen.Return(remote_kspecs_list)
yield kernel_type, attributes

@gen.coroutine
def get_all_specs(self):
Expand Down

0 comments on commit f3ecf87

Please sign in to comment.