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 = ["pywwt", "npm"]
version = "1.5.3"
age = 1

[[projects]]
qnames = ["pywwt", "pypa"]
version = "0.21.0"
age = 0

+++
  • Loading branch information
cranko committed Jul 28, 2023
2 parents 184c1ba + 35f633e commit bc7649c
Show file tree
Hide file tree
Showing 10 changed files with 70 additions and 30 deletions.
22 changes: 16 additions & 6 deletions .check_enabled.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,32 @@
import sys

from jupyterlab.commands import get_app_info
from notebook.nbextensions import validate_nbextension
from notebook.serverextensions import validate_serverextension

try:
from nbclassic.nbextensions import validate_nbextension
except ImportError:
# `notebook` <= 6
from notebook.nbextensions import validate_nbextension

try:
from nbclassic.serverextensions import validate_serverextension
except ImportError:
# `notebook` <= 6
from notebook.serverextensions import validate_serverextension

# If there's a problem and we don't provide this, the validate function crashes :-(
logger = logging.getLogger('')
logger = logging.getLogger("")

if validate_nbextension('pywwt/extension', logger=logger) != []:
if validate_nbextension("pywwt/extension", logger=logger) != []:
print("Issue detected with nbextension")
sys.exit(1)

info = get_app_info()

if 'pywwt' not in info['extensions'] or 'pywwt' in info['disabled']:
if "pywwt" not in info["extensions"] or "pywwt" in info["disabled"]:
print("Issue detected with labextension")
sys.exit(1)

if validate_serverextension('pywwt', logger=logger) != []:
if validate_serverextension("pywwt", logger=logger) != []:
print("Issue detected with serverextension")
sys.exit(1)
1 change: 1 addition & 0 deletions .readthedocs_env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ dependencies:
- krb5
- lxml
- matplotlib
- nbclassic
- nodejs
- notebook
- numpydoc
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# pypa:pywwt 0.21.0 (2023-07-28)

- Update `pywwt` to work with version 7 of the Jupyter `notebook` package (#356,
@Carifio24, @pkgw). This new version is a major update on the Jupyter side,
but it is only used in a few minor places within `pywwt`. The `pywwt` package
should remain compatible with older versions of `notebook`.
- Fix pywwt’s default ecliptic grid color to match the engine (#356,
@Carifio24).


# pypa:pywwt 0.20.0 (2023-07-06)

- Expose new engine settings relating to the display of constellations,
Expand Down
6 changes: 3 additions & 3 deletions ci/azure-build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,9 @@ jobs:
source activate-conda.sh
conda activate build
set -x
\conda install -y jupyterlab jupyter_contrib_nbextensions
jupyter nbextension list
jupyter serverextension list
\conda install -y jupyterlab nbclassic
jupyter nbclassic-extension list
jupyter nbclassic-serverextension list
jupyter labextension list
displayName: Print Jupyter extension status
Expand Down
12 changes: 6 additions & 6 deletions ci/zenodo.json5
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@
],
"language": "eng",
"license": "BSD-3-Clause",
"publication_date": "2023-07-06",
"title": "pypa:pywwt 0.20.0",
"publication_date": "2023-07-28",
"title": "pypa:pywwt 0.21.0",
"upload_type": "software",
"version": "0.20.0"
"version": "0.21.0"
},
"conceptdoi": "10.5281/zenodo.7164147",
"record_id": "8120820",
"doi": "10.5281/zenodo.8120820",
"bucket_link": "https://zenodo.org/api/files/a0907e42-079d-4015-bc52-955559160589"
"record_id": "8193603",
"doi": "10.5281/zenodo.8193603",
"bucket_link": "https://zenodo.org/api/files/7fe44d30-f757-497f-8468-df0bf078b6af"
}
19 changes: 12 additions & 7 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -244,13 +244,18 @@ this repository and install the package manually (note that this requires `npm
cd pywwt
pip install -e .

If you want to use the Jupyter widget, you will also need to run::

jupyter nbextension install --py --symlink --sys-prefix pywwt
jupyter nbextension enable --py --sys-prefix pywwt
jupyter nbextension list # check that the output shows pywwt as enabled and OK
jupyter serverextension enable --py --sys-prefix pywwt
jupyter serverextension list # check that the output shows pywwt as enabled and OK
If you want to use the Jupyter widget with a recent installation of the Jupyter
stack, you will also need to run::

jupyter nbclassic-extension install --py --symlink --sys-prefix pywwt
jupyter nbclassic-extension enable --py --sys-prefix pywwt
jupyter nbclassic-extension list # check that the output shows pywwt as enabled and OK
jupyter nbclassic-serverextension enable --py --sys-prefix pywwt
jupyter nbclassic-serverextension list # check that the output shows pywwt as enabled and OK

On older versions of Jupyter, use the ``nbextension`` subcommand instead of
``nbclassic-extension``, and use just ``serverextension`` instead of
``nbclassic-serverextension``.

And if you additionally want to use the widget in JupyterLab, run::

Expand Down
4 changes: 2 additions & 2 deletions pywwt/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version_info = (0, 20, 0, 'final', 0) # cranko project-version tuple
version_info = (0, 21, 0, 'final', 0) # cranko project-version tuple

_specifier_ = {
"alpha": ".a",
Expand All @@ -18,5 +18,5 @@
)

# The strings are auto-updated by Cranko during formal releases:
version_doi = "10.5281/zenodo.8120820"
version_doi = "10.5281/zenodo.8193603"
concept_doi = "10.5281/zenodo.7164147"
2 changes: 1 addition & 1 deletion pywwt/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ def instruments(self):
).tag(wwt="showEclipticGrid", wwt_reset=True)

ecliptic_grid_color = Color(
"blue", help="The color of the ecliptic grid " "(`str` or `tuple`)"
"green", help="The color of the ecliptic grid " "(`str` or `tuple`)"
).tag(wwt="eclipticGridColor", wwt_reset=True)

ecliptic_text = Bool(
Expand Down
7 changes: 6 additions & 1 deletion pywwt/jupyter_relay.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,11 +519,16 @@ def get_relay_hub(kernel=None):
def _list_running_servers_jl3():
import io
import json
from notebook.utils import check_pid
from jupyter_core.paths import jupyter_runtime_dir
import os.path
import re

try:
from jupyter_server.utils import check_pid
except ImportError:
# `notebook` <= 6
from notebook.utils import check_pid

runtime_dir = jupyter_runtime_dir()

if not os.path.isdir(runtime_dir):
Expand Down
17 changes: 13 additions & 4 deletions pywwt/jupyter_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,21 @@
# so let's try to fail gracefully if Jupyter modules are missing. `tornado` is a
# hard requirement appearing in setup.py.
try:
from notebook.utils import url_path_join
from notebook.base.handlers import IPythonHandler
try:
from jupyter_server.utils import url_path_join
except ImportError:
# `notebook` <= 6
from notebook.utils import url_path_join

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

HAVE_NOTEBOOK = True
except ImportError:
IPythonHandler = object
JupyterHandler = object
HAVE_NOTEBOOK = False

__all__ = [
Expand All @@ -35,7 +44,7 @@
STATIC_DIR = os.path.join(os.path.dirname(__file__), "web_static")


class WWTStaticFileHandler(IPythonHandler):
class WWTStaticFileHandler(JupyterHandler):
def get(self, filename):
static_path = os.path.join(STATIC_DIR, filename)

Expand Down

0 comments on commit bc7649c

Please sign in to comment.