Skip to content

Commit

Permalink
Pin jupyter client < 8 (#378)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
kevin-bates authored Feb 6, 2023
1 parent ece7cbe commit 146c10d
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 15 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ jobs:
strategy:
matrix:
python:
- "3.6"
- "3.6"
- "3.7"
- "3.8"
- "3.9"
Expand Down
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: end-of-file-fixer
2 changes: 1 addition & 1 deletion docs/_static/numpy_friendly.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

table.docutils th.field-name {
white-space: nowrap;
}
}
2 changes: 1 addition & 1 deletion docs/_static/numpy_friendly.css_t
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

table.docutils th.field-name {
white-space: nowrap;
}
}
1 change: 0 additions & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,3 @@ Indices and tables
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

2 changes: 1 addition & 1 deletion docs/source/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ you can access your kernel gateway on the IP address of your Docker host an port

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

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.
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 changes: 12 additions & 3 deletions kernel_gateway/gatewayapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

from tornado import httpserver
from tornado import web
from tornado.log import enable_pretty_logging
from tornado.log import enable_pretty_logging, LogFormatter

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

_log_formatter_cls = LogFormatter # traitlet default is LevelFormatter

@default("log_format")
def _default_log_format(self) -> str:
"""override default log format to include milliseconds"""
return (
"%(color)s[%(levelname)1.1s %(asctime)s.%(msecs).03d %(name)s]%(end_color)s %(message)s"
)

kernel_spec_manager = Instance(KernelSpecManager, allow_none=True)

kernel_spec_manager_class = Type(
Expand Down Expand Up @@ -556,8 +565,8 @@ def init_http_server(self):
def start(self):
"""Starts an IO loop for the application."""
super(KernelGatewayApp, self).start()
self.log.info('Jupyter Kernel Gateway at http{}://{}:{}'.format(
's' if self.keyfile else '', self.ip, self.port
self.log.info('Jupyter Kernel Gateway {} is available at http{}://{}:{}'.format(
KernelGatewayApp.version, 's' if self.keyfile else '', self.ip, self.port
))
self.io_loop = ioloop.IOLoop.current()

Expand Down
2 changes: 1 addition & 1 deletion kernel_gateway/jupyter_websocket/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -590,4 +590,4 @@
}
}
}
}
}
1 change: 0 additions & 1 deletion kernel_gateway/tests/test_jupyter_websocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -823,4 +823,3 @@ def test_seed_language_support(self):
self.assertIn('Gur Mra bs Clguba', content['text'])

ws.close()

2 changes: 1 addition & 1 deletion readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ conda:
file: docs/environment.yml
python:
version: 3


5 changes: 2 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@
],
install_requires=[
'jupyter_core>=4.4.0',
'jupyter_client>=5.2.0',
'jupyter_client>=5.2.0,<8.0', # Pin < 8 until we update packages in #377
'notebook>=5.7.6,<7.0',
'traitlets>=4.2.0',
'tornado>=4.2.0',
'requests>=2.7,<3.0'
],
python_requires='>=3.6.1',
python_requires='>=3.7',
classifiers=[
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
Expand All @@ -69,7 +69,6 @@
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
Expand Down

0 comments on commit 146c10d

Please sign in to comment.