Skip to content

Commit c33a0eb

Browse files
authored
Merge pull request #649 from manics/python-3.8
Require min Python 3.8, jupyter-server 2
2 parents fc96b7e + efd67ce commit c33a0eb

File tree

5 files changed

+44
-45
lines changed

5 files changed

+44
-45
lines changed

.github/workflows/build.yml

Lines changed: 37 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,32 @@ jobs:
88
# https://github.com/pre-commit/action
99
pre-commit:
1010
name: Lint
11-
runs-on: ubuntu-22.04
11+
runs-on: ubuntu-24.04
1212
steps:
13-
- uses: actions/checkout@v4
14-
- uses: actions/setup-python@v5
13+
- uses: actions/checkout@v5
14+
- uses: actions/setup-python@v6
1515
with:
16-
python-version: '3.12'
16+
python-version: '3.13'
1717
- uses: pre-commit/action@v3.0.1
1818

1919
# Due to complications in the build process when trying to support both JupyterLab
2020
# 2 and 3 we build the pypi packages with JupyterLab 3, but test on 2 and 3
2121

2222
build:
2323
name: Build dist
24-
runs-on: ubuntu-22.04
24+
runs-on: ubuntu-24.04
2525
steps:
26-
- uses: actions/checkout@v4
26+
- uses: actions/checkout@v5
2727

28-
- uses: actions/setup-python@v5
28+
- uses: actions/setup-python@v6
2929
with:
30-
python-version: '3.10'
30+
python-version: '3.13'
3131
cache: pip
3232
cache-dependency-path: 'dev-requirements*'
3333

34-
- uses: actions/setup-node@v4
34+
- uses: actions/setup-node@v5
3535
with:
36-
node-version: '20.x'
36+
node-version: '24.x'
3737
cache: yarn
3838

3939
- name: Install dependencies
@@ -74,28 +74,26 @@ jobs:
7474
fail-fast: false
7575
matrix:
7676
include:
77-
- python-version: '3.7'
78-
jupyterlab-major: '3'
79-
- python-version: '3.10'
77+
- python-version: '3.8'
8078
jupyterlab-major: '4'
81-
- python-version: '3.12'
79+
- python-version: '3.13'
8280
jupyterlab-major: '4'
83-
runs-on: ubuntu-22.04
81+
runs-on: ubuntu-24.04
8482
# Includes geckdriver and firefox
8583
# https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2204-Readme.md
8684
steps:
87-
- uses: actions/checkout@v4
85+
- uses: actions/checkout@v5
8886

8987
- name: Set up Python ${{ matrix.python-version }}
90-
uses: actions/setup-python@v5
88+
uses: actions/setup-python@v6
9189
with:
9290
python-version: ${{ matrix.python-version }}
9391
cache: pip
9492
cache-dependency-path: 'dev-requirements*'
9593

96-
- uses: actions/setup-node@v4
94+
- uses: actions/setup-node@v5
9795
with:
98-
node-version: '20.x'
96+
node-version: '24.x'
9997
cache: yarn
10098

10199
- name: Download artifacts from build
@@ -117,41 +115,52 @@ jobs:
117115
# Only publish if other jobs passed
118116
- pre-commit
119117
- test
120-
runs-on: ubuntu-22.04
118+
runs-on: ubuntu-24.04
121119
permissions:
122120
id-token: write
123121
steps:
124122
- name: Download artifacts from build
125-
uses: actions/download-artifact@v4
123+
uses: actions/download-artifact@v5
126124
with:
127125
name: dist
128126
path: dist
129127

130128
- name: Publish to PyPI
131129
if: startsWith(github.ref, 'refs/tags')
132-
uses: pypa/gh-action-pypi-publish@v1.12.4
130+
uses: pypa/gh-action-pypi-publish@v1.13.0
133131

134132
# https://docs.github.com/en/actions/language-and-framework-guides/publishing-nodejs-packages#publishing-packages-to-the-npm-registry
135133
publish-npm:
136134
needs:
137135
# Only publish if other jobs passed
138136
- pre-commit
139137
- test
140-
runs-on: ubuntu-22.04
138+
runs-on: ubuntu-24.04
141139
steps:
142140
# Setup .npmrc file to publish to npm
143-
- uses: actions/setup-node@v4
141+
- uses: actions/setup-node@v5
144142
with:
145-
node-version: '20.x'
143+
node-version: '24.x'
146144
registry-url: https://registry.npmjs.org
147145

146+
- name: Should this be set as latest
147+
run: |
148+
if [[ ${{ github.ref }} =~ ^refs/tags/v?[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
149+
NPM_TAG=latest
150+
else
151+
NPM_TAG=dev
152+
fi
153+
echo "NPM_TAG=$NPM_TAG" >> "$GITHUB_ENV"
154+
148155
- name: Download artifacts from build
149-
uses: actions/download-artifact@v4
156+
uses: actions/download-artifact@v5
150157
with:
151158
name: jsdist
152159
path: jsdist
153-
- run: npm publish --dry-run ./jsdist/jupyter-offlinenotebook-jlpmpack.tgz
154-
- run: npm publish ./jsdist/jupyter-offlinenotebook-jlpmpack.tgz
160+
161+
- run: npm publish --tag "$NPM_TAG" --dry-run ./jsdist/jupyter-offlinenotebook-jlpmpack.tgz
162+
163+
- run: npm publish --tag "$NPM_TAG" ./jsdist/jupyter-offlinenotebook-jlpmpack.tgz
155164
if: startsWith(github.ref, 'refs/tags')
156165
env:
157166
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

dev-requirements-jl3.old

Lines changed: 0 additions & 4 deletions
This file was deleted.

jupyter_offlinenotebook/__init__.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ class OfflineNotebookConfig(Configurable):
102102
).tag(config=True)
103103

104104

105-
def _jupyter_server_extension_paths():
105+
def _jupyter_server_extension_points():
106106
"""
107107
Jupyter server extension
108108
"""
@@ -123,7 +123,7 @@ def _jupyter_nbextension_paths():
123123
]
124124

125125

126-
def load_jupyter_server_extension(nbapp):
126+
def _load_jupyter_server_extension(nbapp):
127127
"""
128128
Called during notebook start
129129
"""
@@ -134,9 +134,3 @@ def load_jupyter_server_extension(nbapp):
134134
nbapp.web_app.settings["base_url"], "/offlinenotebook/config"
135135
)
136136
nbapp.web_app.add_handlers(".*", [(route_pattern, OfflineNotebookHandler)])
137-
138-
139-
# Add compatibility with jupyter-server
140-
# https://jupyter-server.readthedocs.io/en/latest/developers/extensions.html#migrating-an-extension-to-use-jupyter-serverjupyter_server
141-
_load_jupyter_server_extension = load_jupyter_server_extension
142-
_jupyter_server_extension_points = _jupyter_server_extension_paths

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jupyter-offlinenotebook",
3-
"version": "0.3.2",
3+
"version": "0.3.3-dev",
44
"description": "JupyterLab offline-notebook extension.",
55
"keywords": [
66
"jupyter",

setup.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def get_version():
2929
jstargets = [
3030
# notebook
3131
os.path.join(HERE, name, "static", "jslib", "offlinenotebook.js"),
32-
# jupyterlab 3 bundled extension
32+
# jupyterlab 4 bundled extension
3333
os.path.join(HERE, name, "static", "lab", "package.json"),
3434
]
3535

@@ -91,8 +91,8 @@ def get_version():
9191
long_description=open("README.md").read(),
9292
long_description_content_type="text/markdown",
9393
cmdclass=cmdclass,
94-
install_requires=["jupyter-server"],
95-
python_requires=">=3.7",
94+
install_requires=["jupyter-server>=2"],
95+
python_requires=">=3.8",
9696
zip_safe=False,
9797
include_package_data=True,
9898
platforms="Linux, Mac OS X, Windows",
@@ -101,12 +101,12 @@ def get_version():
101101
"License :: OSI Approved :: BSD License",
102102
"Programming Language :: Python",
103103
"Programming Language :: Python :: 3",
104-
"Programming Language :: Python :: 3.7",
105104
"Programming Language :: Python :: 3.8",
106105
"Programming Language :: Python :: 3.9",
107106
"Programming Language :: Python :: 3.10",
108107
"Programming Language :: Python :: 3.11",
109108
"Programming Language :: Python :: 3.12",
109+
"Programming Language :: Python :: 3.13",
110110
"Framework :: Jupyter",
111111
],
112112
)

0 commit comments

Comments
 (0)