Skip to content

Commit 651e91c

Browse files
committed
Merge branch 'master' into example
2 parents ae3d27c + a4e1d53 commit 651e91c

File tree

6 files changed

+54
-22
lines changed

6 files changed

+54
-22
lines changed

.github/workflows/main.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: CI
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
branches: '*'
8+
jobs:
9+
build:
10+
runs-on: ${{ matrix.os }}
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
os: [ubuntu-latest, macos-latest, windows-latest]
15+
python-version: [ '3.6', '3.7', '3.8' ]
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v1
19+
- name: Install Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v1
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
architecture: 'x64'
24+
- name: Install the Python dependencies
25+
run: |
26+
pip install -e .[test]
27+
- name: Run the tests
28+
run: |
29+
nosetests -v jupyter_server

.travis.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ cache:
55
directories:
66
- $HOME/.cache/bower
77
- $HOME/.cache/pip
8-
python:
9-
- 3.6
10-
118
env:
129
global:
1310
- PATH=$TRAVIS_BUILD_DIR/pandoc:$PATH
@@ -28,7 +25,6 @@ install:
2825
- pip freeze
2926
- wget https://github.com/jgm/pandoc/releases/download/1.19.1/pandoc-1.19.1-1-amd64.deb && sudo dpkg -i pandoc-1.19.1-1-amd64.deb
3027

31-
3228
script:
3329
- jupyter kernelspec list
3430
- |
@@ -41,7 +37,7 @@ script:
4137
else
4238
true
4339
fi
44-
- 'if [[ $GROUP == python ]]; then nosetests -v --with-coverage --cover-package=jupyter_server jupyter_server; fi'
40+
- 'if [[ $GROUP == python ]]; then nosetests -v jupyter_server; fi'
4541
- |
4642
if [[ $GROUP == docs ]]; then
4743
EXIT_STATUS=0
@@ -54,17 +50,20 @@ script:
5450
exit $EXIT_STATUS
5551
fi
5652
57-
5853
matrix:
5954
include:
60-
- python: 3.5
55+
- python: 3.6
6156
env: GROUP=python
6257
- python: 3.7
6358
env: GROUP=python
6459
- python: 3.8
6560
env: GROUP=python
6661
- python: 3.6
6762
env: GROUP=docs
63+
- python: 3.7
64+
env: GROUP=docs
65+
- python: 3.8
66+
env: GROUP=docs
6867

6968
after_success:
7069
- codecov

appveyor.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ environment:
66
matrix:
77
- CONDA_PY: 36
88
CONDA_INSTALL_LOCN: "C:\\Miniconda36-x64"
9+
- CONDA_PY: 37
10+
CONDA_INSTALL_LOCN: "C:\\Miniconda36-x64"
11+
- CONDA_PY: 38
12+
CONDA_INSTALL_LOCN: "C:\\Miniconda36-x64"
913

1014
platform:
1115
- x64
@@ -21,4 +25,4 @@ install:
2125
- cmd: pip install .[test]
2226

2327
test_script:
24-
- nosetests -v jupyter_server --exclude-dir notebook\tests\selenium
28+
- nosetests -v jupyter_server --exclude-dir jupyter_server\tests\selenium

jupyter_server/gateway/managers.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -283,12 +283,12 @@ def gateway_request(endpoint, **kwargs):
283283
except ConnectionRefusedError:
284284
raise web.HTTPError(503, "Connection refused from Gateway server url '{}'. "
285285
"Check to be sure the Gateway instance is running.".format(GatewayClient.instance().url))
286-
except HTTPError:
286+
except HTTPError as e:
287287
# This can occur if the host is valid (e.g., foo.com) but there's nothing there.
288-
raise web.HTTPError(504, "Error attempting to connect to Gateway server url '{}'. "
288+
raise web.HTTPError(e.code, "Error attempting to connect to Gateway server url '{}'. "
289289
"Ensure gateway url is valid and the Gateway instance is running.".
290290
format(GatewayClient.instance().url))
291-
except gaierror as e:
291+
except gaierror:
292292
raise web.HTTPError(404, "The Gateway server specified in the gateway_url '{}' doesn't appear to be valid. "
293293
"Ensure gateway url is valid and the Gateway instance is running.".
294294
format(GatewayClient.instance().url))
@@ -390,8 +390,8 @@ def get_kernel(self, kernel_id=None, **kwargs):
390390
self.log.debug("Request kernel at: %s" % kernel_url)
391391
try:
392392
response = yield gateway_request(kernel_url, method='GET')
393-
except HTTPError as error:
394-
if error.code == 404:
393+
except web.HTTPError as error:
394+
if error.status_code == 404:
395395
self.log.warn("Kernel not found at: %s" % kernel_url)
396396
self.remove_kernel(kernel_id)
397397
kernel = None
@@ -559,8 +559,8 @@ def get_kernel_spec(self, kernel_name, **kwargs):
559559
self.log.debug("Request kernel spec at: %s" % kernel_spec_url)
560560
try:
561561
response = yield gateway_request(kernel_spec_url, method='GET')
562-
except HTTPError as error:
563-
if error.code == 404:
562+
except web.HTTPError as error:
563+
if error.status_code == 404:
564564
# Convert not found to KeyError since that's what the Notebook handler expects
565565
# message is not used, but might as well make it useful for troubleshooting
566566
raise KeyError('kernelspec {kernel_name} not found on Gateway server at: {gateway_url}'.
@@ -587,8 +587,8 @@ def get_kernel_spec_resource(self, kernel_name, path):
587587
self.log.debug("Request kernel spec resource '{}' at: {}".format(path, kernel_spec_resource_url))
588588
try:
589589
response = yield gateway_request(kernel_spec_resource_url, method='GET')
590-
except HTTPError as error:
591-
if error.code == 404:
590+
except web.HTTPError as error:
591+
if error.status_code == 404:
592592
kernel_spec_resource = None
593593
else:
594594
raise

jupyter_server/tests/test_gateway.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
import uuid
55
from datetime import datetime
66
from tornado import gen
7-
from tornado.httpclient import HTTPRequest, HTTPResponse, HTTPError
7+
from tornado.web import HTTPError
8+
from tornado.httpclient import HTTPRequest, HTTPResponse
89
from ipython_genutils.py3compat import str_to_unicode
910
from .launchserver import ServerTestBase
1011
from jupyter_server.gateway.managers import GatewayClient

setup.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
name = "jupyter_server"
2020

2121
# Minimal Python version sanity check
22-
if sys.version_info < (3,5):
23-
error = "ERROR: %s requires Python version 3.5 or above." % name
22+
if sys.version_info < (3,6):
23+
error = "ERROR: %s requires Python version 3.6 or above." % name
2424
print(error, file=sys.stderr)
2525
sys.exit(1)
2626

@@ -67,7 +67,6 @@
6767
'License :: OSI Approved :: BSD License',
6868
'Programming Language :: Python',
6969
'Programming Language :: Python :: 3',
70-
'Programming Language :: Python :: 3.5',
7170
'Programming Language :: Python :: 3.6',
7271
'Programming Language :: Python :: 3.7',
7372
],
@@ -95,7 +94,7 @@
9594
'nbval', 'nose-exclude', 'selenium', 'pytest', 'pytest-cov'],
9695
'test:sys_platform == "win32"': ['nose-exclude'],
9796
},
98-
python_requires = '>=3.5',
97+
python_requires = '>=3.6',
9998
entry_points = {
10099
'console_scripts': [
101100
'jupyter-server = jupyter_server.serverapp:main',

0 commit comments

Comments
 (0)