Skip to content

Commit

Permalink
Release commit created with Cranko.
Browse files Browse the repository at this point in the history
+++ cranko-release-info-v1
[[projects]]
qnames = ["wwt_kernel_data_relay", "pypa"]
version = "0.3.0"
age = 0

+++
  • Loading branch information
cranko committed Aug 18, 2023
2 parents bd5e5e8 + f6b5584 commit 42f37c9
Show file tree
Hide file tree
Showing 13 changed files with 76 additions and 52 deletions.
9 changes: 5 additions & 4 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
version: 2

build:
image: latest
os: ubuntu-22.04
tools:
python: "3.10"

python:
version: 3.7
install:
- method: pip
path: .
extra_requirements:
- docs

# Don't build any extra formats
formats: []
sphinx:
configuration: docs/conf.py
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# wwt_kernel_data_relay 0.3.0 (2023-08-18)

- Add support for JupyterLab 4 / Notebook v7 (#5, @pkgw). Support for older
versions should remain unchanged. This is basically just a matter of trying to
pull in some dependencies from newer locations before falling back to older
ones.
- Some branding / contact info updates for the sponsorship migration (#5,
@pkgw).


# wwt_kernel_data_relay 0.2.0 (2021-10-25)

- Require and use message sequencing numbers in kernel replies (#2, @pkgw).
Expand Down
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
[wwt_kernel_data_relay] is a [Jupyter server extension][ext] that enables
[Jupyter kernels][kernels] to publish some of their data files to the Web; that
is, to request that the Jupyter HTTP server make them accessible at a
predictable URL. This functionality is used by [pywwt], the [AAS] [WorldWide
predictable URL. This functionality is used by [pywwt], the [WorldWide
Telescope] Python library, to expose kernel-side data assets for visualization
inside the WWT [research app][rapp].

[wwt_kernel_data_relay]: https://github.com/WorldWideTelescope/wwt_kernel_data_relay/
[ext]: https://jupyter-notebook.readthedocs.io/en/stable/extending/handlers.html
[ext]: https://jupyter-server.readthedocs.io/en/stable/developers/extensions.html
[kernels]: https://jupyter.readthedocs.io/en/latest/projects/kernels.html
[pywwt]: https://pywwt.readthedocs.io/
[AAS]: https://aas.org/
Expand Down Expand Up @@ -56,7 +56,11 @@ maintained by
## Dependencies

[wwt_kernel_data_relay] is a [Jupyter server extension][ext] so it is only
useful if the Jupyter [notebook] package is installed.
useful if the Jupyter [jupyter_server] package is installed.

[jupyter_server]: https://jupyter-server.readthedocs.io/

It also is compatible with the older (version <= 6) [notebook] server package.

[notebook]: https://jupyter-notebook.readthedocs.io/

Expand All @@ -69,10 +73,10 @@ useful if the Jupyter [notebook] package is installed.

## Acknowledgments

[wwt_kernel_data_relay] is part of the AAS WorldWide Telescope system, a [.NET
Foundation] project managed by the non-profit [American Astronomical Society]
(AAS). Work on WWT has been supported by the AAS, the US [National Science
Foundation], and other partners. See [the WWT user website][acks] for details.
[wwt_kernel_data_relay] is part of the WorldWide Telescope system, a [.NET
Foundation] project. Work on WWT has been supported by the [American
Astronomical Society] (AAS), the US [National Science Foundation], and other
partners. See [the WWT user website][acks] for details.

[.NET Foundation]: https://dotnetfoundation.org/
[American Astronomical Society]: https://aas.org/
Expand Down
8 changes: 4 additions & 4 deletions ci/azure-build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ parameters:
default:

- name: linux_39
vmImage: ubuntu-20.04
vmImage: ubuntu-22.04
vars:
PYTHON_SERIES: "3.9"

- name: macos_39
vmImage: macos-10.15
vmImage: macos-12
vars:
PYTHON_SERIES: "3.9"

- name: windows_39
vmImage: windows-2019
vmImage: windows-2022
vars:
PYTHON_SERIES: "3.9"

Expand Down Expand Up @@ -54,7 +54,7 @@ jobs:
- job: docs
pool:
vmImage: ubuntu-20.04
vmImage: ubuntu-latest
steps:
- template: azure-job-setup.yml
parameters:
Expand Down
8 changes: 4 additions & 4 deletions ci/azure-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ jobs:
- ${{ if parameters.isMainDev }}:
- job: dummy_setup_only
pool:
vmImage: ubuntu-20.04
vmImage: ubuntu-latest
steps:
- template: azure-job-setup.yml

- ${{ if parameters.isRelease }}:
- job: branch_and_tag
pool:
vmImage: ubuntu-20.04
vmImage: ubuntu-latest
variables:
- group: Deployment Credentials
steps:
Expand All @@ -44,7 +44,7 @@ jobs:
- job: github_releases
dependsOn: branch_and_tag # otherwise, GitHub creates the tag itself
pool:
vmImage: ubuntu-20.04
vmImage: ubuntu-latest
variables:
- group: Deployment Credentials
steps:
Expand All @@ -61,7 +61,7 @@ jobs:
- job: python_publish
pool:
vmImage: ubuntu-20.04
vmImage: ubuntu-latest
variables:
- group: Deployment Credentials
steps:
Expand Down
4 changes: 2 additions & 2 deletions ci/azure-sdist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:

- job: sdist
pool:
vmImage: ubuntu-20.04
vmImage: ubuntu-latest

steps:

Expand Down Expand Up @@ -53,8 +53,8 @@ jobs:
conda config --add channels conda-forge
conda install -y \
jupyter_client \
jupyter_server \
jupyter-packaging \
notebook \
tornado \
traitlets
displayName: Set up dependencies
Expand Down
6 changes: 3 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# -*- coding: utf-8 -*-

project = 'wwt_kernel_data_relay'
author = 'The AAS WorldWide Telescope Team'
copyright = '2019-2021 the .NET Foundation'
author = 'The WorldWide Telescope Team'
copyright = '2019-2023 the .NET Foundation'

release = '0.dev0' # cranko project-version
version = '.'.join(release.split('.')[:2])
Expand All @@ -21,7 +21,7 @@
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
language = None
language = 'en'
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
pygments_style = 'sphinx'
todo_include_todos = False
Expand Down
12 changes: 5 additions & 7 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ functionality is used by `pywwt`_ to expose kernel-side data assets for
visualization inside the `WWT research app`_.

.. _wwt_kernel_data_relay: https://github.com/WorldWideTelescope/wwt_kernel_data_relay/
.. _Jupyter server extension: https://jupyter-notebook.readthedocs.io/en/stable/extending/handlers.html
.. _Jupyter server extension: https://jupyter-server.readthedocs.io/en/stable/developers/extensions.html
.. _Jupyter kernels: https://jupyter.readthedocs.io/en/latest/projects/kernels.html
.. _pywwt: https://pywwt.readthedocs.io/
.. _WWT research app: https://docs.worldwidetelescope.org/research-app/latest/
Expand Down Expand Up @@ -37,14 +37,12 @@ issue `on its GitHub repository
Acknowledgments
===============

`wwt_kernel_data_relay`_ is part of the `AAS`_ `WorldWide Telescope`_ system, a
`.NET Foundation`_ project managed by the non-profit `American Astronomical
Society`_ (AAS). Work on WWT has been supported by the AAS, the US `National
Science Foundation`_, and other partners. See `the WWT user website`_ for
details.
`wwt_kernel_data_relay`_ is part of the `WorldWide Telescope`_ system, a `.NET
Foundation`_ project. Work on WWT has been supported by the `American
Astronomical Society`_ (AAS), the US `National Science Foundation`_, and other
partners. See `the WWT user website`_ for details.

.. _.NET Foundation: https://dotnetfoundation.org/
.. _AAS: https://aas.org/
.. _WorldWide Telescope: https://worldwidetelescope.org/home/
.. _American Astronomical Society: https://aas.org/
.. _National Science Foundation: https://www.nsf.gov/
Expand Down
4 changes: 2 additions & 2 deletions docs/specification.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The URLs that are ultimately provided by the KDR have the form:
{base-url}/wwtkdr/{key}/{entry...}
Here, ``base-url`` is the base URL of the Jupyter notebook server, which is
Here, ``base-url`` is the base URL of the Jupyter server, which is
easily determined on the server side and is not-so-easily determined on the
kernel side. The base URL is not necessarily absolute, however, and there may be
different kinds of proxies or redirectors in place that prevent either the
Expand Down Expand Up @@ -115,7 +115,7 @@ JSON content, the *first* reply message must contain additional fields
(analogous to HTTP header data). Every reply message, except for the last one,
must also be associated with one or more byte buffers, which contain the
resource binary content to be returned to the client that has connected to the
notebook server. The final reply message is allowed to arrive without any
server. The final reply message is allowed to arrive without any
associated buffers.

The JSON content of the *every* reply message should contain the following fields:
Expand Down
6 changes: 2 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
[build-system]
requires = ["jupyter_packaging~=0.10,<2", "jupyterlab~=3.1"]
requires = ["jupyter_packaging~=0.10,<2"]
build-backend = "jupyter_packaging.build_api"

[tool.cranko]
extra_python_rewrite_files = [
"docs/conf.py"
]
extra_python_rewrite_files = ["docs/conf.py"]
9 changes: 4 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ def get_long_desc():

setup_args = dict(
name="wwt_kernel_data_relay", # cranko project-name
version="0.2.0", # cranko project-version
version="0.3.0", # cranko project-version
description="Jupyter server extension to allow kernels to make data web-accessible",
long_description=get_long_desc(),
long_description_content_type="text/markdown",
url="https://github.com/WorldWideTelescope/wwt_kernel_data_relay/",
license="MIT",
platforms="Linux, Mac OS X, Windows",
author="AAS WorldWide Telescope Team",
author_email="wwt@aas.org",
author="WorldWide Telescope Team",
author_email="hello@worldwidetelescope.org",
classifiers=[
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
Expand All @@ -71,12 +71,11 @@ def get_long_desc():
],
packages=[
"wwt_kernel_data_relay",
#'wwt_kernel_data_relay.tests',
],
include_package_data=True,
install_requires=[
"jupyter-client>=7",
"notebook>=6",
"jupyter-server>=2",
"tornado>=6",
"traitlets>=5",
],
Expand Down
7 changes: 5 additions & 2 deletions wwt_kernel_data_relay/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@

from .serverextension import load_jupyter_server_extension # noqa

# See: https://jupyter-notebook.readthedocs.io/en/stable/examples/Notebook/Distributing%20Jupyter%20Extensions%20as%20Python%20Packages.html
def _jupyter_server_extension_paths():
# See: https://jupyter.readthedocs.io/en/latest/projects/kernels.html
def _jupyter_server_extension_points():
return [{"module": "wwt_kernel_data_relay.serverextension"}]

# Backwards compatibility
_jupyter_server_extension_paths = _jupyter_server_extension_points
27 changes: 19 additions & 8 deletions wwt_kernel_data_relay/serverextension.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2021 the .NET Foundation
# Copyright 2021-2023 the .NET Foundation
# Licensed under the MIT License

"""
Expand All @@ -8,11 +8,18 @@
import json
from queue import Empty

from tornado import gen, web
from tornado import web

from jupyter_client.session import Session
from notebook.utils import url_path_join
from notebook.base.handlers import IPythonHandler

try:
from jupyter_server.utils import url_path_join
from jupyter_server.base.handlers import JupyterHandler
except ImportError:
# `notebook` <= 6
from notebook.utils import url_path_join
from notebook.base.handlers import IPythonHandler as JupyterHandler

from traitlets.config.configurable import LoggingConfigurable

__all__ = ["load_jupyter_server_extension"]
Expand Down Expand Up @@ -75,7 +82,7 @@ def watch_new_kernel(self, kernel_id, km):
self.log_debug("watching kernel %s in session %s", kernel_id, session.session)

def watch_iopubs(msg_list):
idents, fed_msg_list = session.feed_identities(msg_list)
_idents, fed_msg_list = session.feed_identities(msg_list)
msg = session.deserialize(fed_msg_list)
msg_type = msg["header"]["msg_type"]

Expand Down Expand Up @@ -184,7 +191,7 @@ def finish_reply_buffering(self, msg_id):
pass


class DataRequestHandler(IPythonHandler):
class DataRequestHandler(JupyterHandler):
def initialize(self, registry):
self.registry = registry

Expand Down Expand Up @@ -301,7 +308,7 @@ async def get(self, key, entry):
self.finish()


class ProbeRequestHandler(IPythonHandler):
class ProbeRequestHandler(JupyterHandler):
@web.authenticated
def get(self):
info = {"status": "ok"}
Expand All @@ -312,7 +319,7 @@ def get(self):
self.finish()


def load_jupyter_server_extension(nb_server_app):
def _load_jupyter_server_extension(nb_server_app):
"""
Initialize the server extension.
Expand Down Expand Up @@ -356,3 +363,7 @@ def shimmed_start_watching_activity(kernel_id):
registry.watch_new_kernel(kernel_id, km)

app_km.start_watching_activity = shimmed_start_watching_activity


# Backwards compatibility
load_jupyter_server_extension = _load_jupyter_server_extension

0 comments on commit 42f37c9

Please sign in to comment.