Skip to content

Commit 146c10d

Browse files
authored
Pin jupyter client < 8 (#378)
* Cap jupyter_client < 8 * Update log formatting to include timestamp, add version to startup message * Drop python 3.6 from CI matrix * Add pre-commit, ensure newline at EOF
1 parent ece7cbe commit 146c10d

File tree

11 files changed

+24
-15
lines changed

11 files changed

+24
-15
lines changed

.github/workflows/tests.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ jobs:
3131
strategy:
3232
matrix:
3333
python:
34-
- "3.6"
35-
- "3.6"
3634
- "3.7"
3735
- "3.8"
3836
- "3.9"

.pre-commit-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.4.0
4+
hooks:
5+
- id: end-of-file-fixer

docs/_static/numpy_friendly.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
table.docutils th.field-name {
44
white-space: nowrap;
5-
}
5+
}

docs/_static/numpy_friendly.css_t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
table.docutils th.field-name {
44
white-space: nowrap;
5-
}
5+
}

docs/source/index.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,3 @@ Indices and tables
8181
* :ref:`genindex`
8282
* :ref:`modindex`
8383
* :ref:`search`
84-

docs/source/troubleshooting.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ you can access your kernel gateway on the IP address of your Docker host an port
1212

1313
## Kernel gateway raises an error when I use `notebook-http` mode.
1414

15-
The `notebook-http` mode publishes a web API defined by annotations and code in a notebook. Make sure you are specifying a path or URL of a notebook (`*.ipynb`) file when you launch the kernel gateway in this mode. Set the `--KernelGatewayApp.seed_uri` command line parameter or `KG_SEED_URI` environment variable to do so.
15+
The `notebook-http` mode publishes a web API defined by annotations and code in a notebook. Make sure you are specifying a path or URL of a notebook (`*.ipynb`) file when you launch the kernel gateway in this mode. Set the `--KernelGatewayApp.seed_uri` command line parameter or `KG_SEED_URI` environment variable to do so.

kernel_gateway/gatewayapp.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
from tornado import httpserver
3434
from tornado import web
35-
from tornado.log import enable_pretty_logging
35+
from tornado.log import enable_pretty_logging, LogFormatter
3636

3737
from notebook.notebookapp import random_ports
3838
from ._version import __version__
@@ -310,6 +310,15 @@ def ssl_version_default(self):
310310
ssl_from_env = os.getenv(self.ssl_version_env)
311311
return ssl_from_env if ssl_from_env is None else int(ssl_from_env)
312312

313+
_log_formatter_cls = LogFormatter # traitlet default is LevelFormatter
314+
315+
@default("log_format")
316+
def _default_log_format(self) -> str:
317+
"""override default log format to include milliseconds"""
318+
return (
319+
"%(color)s[%(levelname)1.1s %(asctime)s.%(msecs).03d %(name)s]%(end_color)s %(message)s"
320+
)
321+
313322
kernel_spec_manager = Instance(KernelSpecManager, allow_none=True)
314323

315324
kernel_spec_manager_class = Type(
@@ -556,8 +565,8 @@ def init_http_server(self):
556565
def start(self):
557566
"""Starts an IO loop for the application."""
558567
super(KernelGatewayApp, self).start()
559-
self.log.info('Jupyter Kernel Gateway at http{}://{}:{}'.format(
560-
's' if self.keyfile else '', self.ip, self.port
568+
self.log.info('Jupyter Kernel Gateway {} is available at http{}://{}:{}'.format(
569+
KernelGatewayApp.version, 's' if self.keyfile else '', self.ip, self.port
561570
))
562571
self.io_loop = ioloop.IOLoop.current()
563572

kernel_gateway/jupyter_websocket/swagger.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,4 +590,4 @@
590590
}
591591
}
592592
}
593-
}
593+
}

kernel_gateway/tests/test_jupyter_websocket.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -823,4 +823,3 @@ def test_seed_language_support(self):
823823
self.assertIn('Gur Mra bs Clguba', content['text'])
824824

825825
ws.close()
826-

readthedocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ conda:
22
file: docs/environment.yml
33
python:
44
version: 3
5-
5+

setup.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@
5454
],
5555
install_requires=[
5656
'jupyter_core>=4.4.0',
57-
'jupyter_client>=5.2.0',
57+
'jupyter_client>=5.2.0,<8.0', # Pin < 8 until we update packages in #377
5858
'notebook>=5.7.6,<7.0',
5959
'traitlets>=4.2.0',
6060
'tornado>=4.2.0',
6161
'requests>=2.7,<3.0'
6262
],
63-
python_requires='>=3.6.1',
63+
python_requires='>=3.7',
6464
classifiers=[
6565
'Intended Audience :: Developers',
6666
'Intended Audience :: System Administrators',
@@ -69,7 +69,6 @@
6969
'Operating System :: OS Independent',
7070
'Programming Language :: Python',
7171
'Programming Language :: Python :: 3',
72-
'Programming Language :: Python :: 3.6',
7372
'Programming Language :: Python :: 3.7',
7473
'Programming Language :: Python :: 3.8',
7574
'Programming Language :: Python :: 3.9',

0 commit comments

Comments
 (0)