Skip to content

Commit 56dadf5

Browse files
minrkkevin-bates
authored andcommitted
require Python 3.5
3.4 doesn't have isawaitable remove unsupported combinations from test matrix
1 parent a0c96cf commit 56dadf5

File tree

7 files changed

+18
-35
lines changed

7 files changed

+18
-35
lines changed

.travis.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,6 @@ matrix:
6868
dist: xenial # required for Python >= 3.7 (travis-ci/travis-ci#9069)
6969
- python: 3.6
7070
env: GROUP=docs
71-
- python: 3.6
72-
env:
73-
- GROUP=python
74-
- EXTRA_PIP="tornado<5"
7571

7672
after_success:
7773
- codecov

jupyter_server/files/handlers.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,11 @@
66
import mimetypes
77
import json
88
from base64 import decodebytes
9-
10-
from base64 import decodebytes
11-
129
from tornado import gen, web
13-
1410
from jupyter_server.base.handlers import JupyterHandler
1511
from jupyter_server.utils import maybe_future
1612

1713

18-
1914
class FilesHandler(JupyterHandler):
2015
"""serve files via ContentsManager
2116

jupyter_server/services/kernels/handlers.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,7 @@ def post(self, kernel_id, action):
8787
self.log.error("Exception restarting kernel", exc_info=True)
8888
self.set_status(500)
8989
else:
90-
<<<<<<< HEAD
91-
model = yield gen.maybe_future(km.kernel_model(kernel_id))
92-
=======
9390
model = yield maybe_future(km.kernel_model(kernel_id))
94-
>>>>>>> use our own maybe_future
9591
self.write(json.dumps(model, default=date_default))
9692
self.finish()
9793

jupyter_server/services/sessions/sessionmanager.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,18 @@ class SessionManager(LoggingConfigurable):
2424

2525
kernel_manager = Instance('jupyter_server.services.kernels.kernelmanager.MappingKernelManager')
2626
contents_manager = Instance('jupyter_server.services.contents.manager.ContentsManager')
27-
27+
2828
# Session database initialized below
2929
_cursor = None
3030
_connection = None
3131
_columns = {'session_id', 'path', 'name', 'type', 'kernel_id'}
32-
32+
3333
@property
3434
def cursor(self):
3535
"""Start a cursor and create a database called 'session'"""
3636
if self._cursor is None:
3737
self._cursor = self.connection.cursor()
38-
self._cursor.execute("""CREATE TABLE session
38+
self._cursor.execute("""CREATE TABLE session
3939
(session_id, path, name, type, kernel_id)""")
4040
return self._cursor
4141

@@ -46,7 +46,7 @@ def connection(self):
4646
self._connection = sqlite3.connect(':memory:')
4747
self._connection.row_factory = sqlite3.Row
4848
return self._connection
49-
49+
5050
def close(self):
5151
"""Close the sqlite connection"""
5252
if self._cursor is not None:
@@ -106,11 +106,11 @@ def start_kernel_for_session(self, session_id, path, name, type, kernel_name):
106106
@gen.coroutine
107107
def save_session(self, session_id, path=None, name=None, type=None, kernel_id=None):
108108
"""Saves the items for the session with the given session_id
109-
109+
110110
Given a session_id (and any other of the arguments), this method
111111
creates a row in the sqlite session database that holds the information
112112
for a session.
113-
113+
114114
Parameters
115115
----------
116116
session_id : str
@@ -123,7 +123,7 @@ def save_session(self, session_id, path=None, name=None, type=None, kernel_id=No
123123
the type of the session
124124
kernel_id : str
125125
a uuid for the kernel associated with this session
126-
126+
127127
Returns
128128
-------
129129
model : dict
@@ -138,7 +138,7 @@ def save_session(self, session_id, path=None, name=None, type=None, kernel_id=No
138138
@gen.coroutine
139139
def get_session(self, **kwargs):
140140
"""Returns the model for a particular session.
141-
141+
142142
Takes a keyword argument and searches for the value in the session
143143
database, then returns the rest of the session's info.
144144
@@ -151,7 +151,7 @@ def get_session(self, **kwargs):
151151
Returns
152152
-------
153153
model : dict
154-
returns a dictionary that includes all the information from the
154+
returns a dictionary that includes all the information from the
155155
session described by the kwarg.
156156
"""
157157
if not kwargs:
@@ -185,17 +185,17 @@ def get_session(self, **kwargs):
185185
@gen.coroutine
186186
def update_session(self, session_id, **kwargs):
187187
"""Updates the values in the session database.
188-
188+
189189
Changes the values of the session with the given session_id
190-
with the values from the keyword arguments.
191-
190+
with the values from the keyword arguments.
191+
192192
Parameters
193193
----------
194194
session_id : str
195195
a uuid that identifies a session in the sqlite3 database
196196
**kwargs : str
197197
the key must correspond to a column title in session database,
198-
and the value replaces the current value in the session
198+
and the value replaces the current value in the session
199199
with session_id.
200200
"""
201201
yield maybe_future(self.get_session(session_id=session_id))

jupyter_server/services/sessions/tests/test_sessionmanager.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,22 @@
1111
from jupyter_server.services.contents.manager import ContentsManager
1212
from jupyter_server._tz import utcnow, isoformat
1313

14-
1514
class DummyKernel(object):
1615
def __init__(self, kernel_name='python'):
1716
self.kernel_name = kernel_name
1817

1918
dummy_date = utcnow()
2019
dummy_date_s = isoformat(dummy_date)
2120

22-
2321
class DummyMKM(MappingKernelManager):
2422
"""MappingKernelManager interface that doesn't start kernels, for testing"""
25-
2623
def __init__(self, *args, **kwargs):
2724
super(DummyMKM, self).__init__(*args, **kwargs)
2825
self.id_letters = iter(u'ABCDEFGHIJK')
2926

3027
def _new_id(self):
3128
return next(self.id_letters)
32-
29+
3330
def start_kernel(self, kernel_id=None, path=None, kernel_name='python', **kwargs):
3431
kernel_id = kernel_id or self._new_id()
3532
k = self._kernels[kernel_id] = DummyKernel(kernel_name=kernel_name)
@@ -43,7 +40,7 @@ def shutdown_kernel(self, kernel_id, now=False):
4340

4441

4542
class TestSessionManager(TestCase):
46-
43+
4744
def setUp(self):
4845
self.sm = SessionManager(
4946
kernel_manager=DummyMKM(),
@@ -62,7 +59,7 @@ def co_add():
6259
sessions.append(session)
6360
raise gen.Return(sessions)
6461
return self.loop.run_sync(co_add)
65-
62+
6663
def create_session(self, **kwargs):
6764
return self.create_sessions(kwargs)[0]
6865

@@ -201,7 +198,7 @@ def test_update_session(self):
201198
}
202199
}
203200
self.assertEqual(model, expected)
204-
201+
205202
def test_bad_update_session(self):
206203
# try to update a session with a bad keyword ~ raise error
207204
sm = self.sm

jupyter_server/utils.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,6 @@ def _check_pid_posix(pid):
385385

386386
def maybe_future(obj):
387387
"""Like tornado's deprecated gen.maybe_future
388-
389388
but more compatible with asyncio for recent versions
390389
of tornado
391390
"""

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
'nbval', 'nose-exclude', 'selenium', 'pytest', 'pytest-cov'],
9696
'test:sys_platform == "win32"': ['nose-exclude'],
9797
},
98-
python_requires='>=3.5',
98+
python_requires = '>=3.5',
9999
entry_points = {
100100
'console_scripts': [
101101
'jupyter-server = jupyter_server.serverapp:main',

0 commit comments

Comments
 (0)