Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with Jupyterlab 4 #95

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1

- name: Install dependencies
run: python -m pip install -U jupyterlab~=3.1
run: python -m pip install -U jupyterlab~=4.1

- name: Lint the extension
run: |
Expand Down Expand Up @@ -77,7 +77,7 @@ jobs:
sudo rm -rf $(which node)
sudo rm -rf $(which node)

pip install "jupyterlab~=3.1" jupyterlab_mol_visualizer*.whl
pip install "jupyterlab~=4.1" jupyterlab_mol_visualizer*.whl


jupyter labextension list
Expand Down Expand Up @@ -107,7 +107,7 @@ jobs:
- name: Install the extension
run: |
set -eux
python -m pip install "jupyterlab~=3.1" jupyterlab_mol_visualizer*.whl
python -m pip install "jupyterlab~=4.1" jupyterlab_mol_visualizer*.whl

- name: Install dependencies
working-directory: ui-tests
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/enforce-label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Enforce PR label

on:
pull_request:
types: [labeled, unlabeled, opened, edited, synchronize]
jobs:
enforce-label:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: enforce-triage-label
uses: jupyterlab/maintainer-tools/.github/actions/enforce-label@v1
46 changes: 46 additions & 0 deletions .github/workflows/prep-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: "Step 1: Prep Release"
on:
workflow_dispatch:
inputs:
version_spec:
description: "New Version Specifier"
default: "next"
required: false
branch:
description: "The branch to target"
required: false
post_version_spec:
description: "Post Version Specifier"
required: false
# silent:
# description: "Set a placeholder in the changelog and don't publish the release."
# required: false
# type: boolean
since:
description: "Use PRs with activity since this date or git reference"
required: false
since_last_stable:
description: "Use PRs with activity since the last stable git tag"
required: false
type: boolean
jobs:
prep_release:
runs-on: ubuntu-latest
steps:
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1

- name: Prep Release
id: prep-release
uses: jupyter-server/jupyter_releaser/.github/actions/prep-release@v2
with:
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
version_spec: ${{ github.event.inputs.version_spec }}
post_version_spec: ${{ github.event.inputs.post_version_spec }}
branch: ${{ github.event.inputs.branch }}
# silent: ${{ github.event.inputs.silent }}
since: ${{ github.event.inputs.since }}
since_last_stable: ${{ github.event.inputs.since_last_stable }}

- name: "** Next Step **"
run: |
echo "Optional): Review Draft Release: ${{ steps.prep-release.outputs.release_url }}"
57 changes: 57 additions & 0 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: "Step 2: Publish Release"
on:
workflow_dispatch:
inputs:
branch:
description: "The target branch"
required: false
release_url:
description: "The URL of the draft GitHub release"
required: false
steps_to_skip:
description: "Comma separated list of steps to skip"
required: false

jobs:
publish_release:
runs-on: ubuntu-latest
permissions:
# This is useful if you want to use PyPI trusted publisher
# and NPM provenance
id-token: write
steps:
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1

- name: Populate Release
id: populate-release
uses: jupyter-server/jupyter_releaser/.github/actions/populate-release@v2
with:
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
branch: ${{ github.event.inputs.branch }}
release_url: ${{ github.event.inputs.release_url }}
steps_to_skip: ${{ github.event.inputs.steps_to_skip }}

- name: Finalize Release
id: finalize-release
env:
# The following are needed if you use legacy PyPI set up
# PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
# PYPI_TOKEN_MAP: ${{ secrets.PYPI_TOKEN_MAP }}
# TWINE_USERNAME: __token__
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
uses: jupyter-server/jupyter_releaser/.github/actions/finalize-release@v2
with:
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
release_url: ${{ steps.populate-release.outputs.release_url }}

- name: "** Next Step **"
if: ${{ success() }}
run: |
echo "Verify the final release"
echo ${{ steps.finalize-release.outputs.release_url }}

- name: "** Failure Message **"
if: ${{ failure() }}
run: |
echo "Failed to Publish the Draft Release Url:"
echo ${{ steps.populate-release.outputs.release_url }}
2 changes: 1 addition & 1 deletion .github/workflows/update-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1

- name: Install dependencies
run: python -m pip install -U jupyterlab~=3.1
run: python -m pip install -U jupyterlab~=4.1

- name: Install extension
run: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.yarn
*.bundle.*
lib/
node_modules/
Expand Down
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ A JupyterLab launcher extension to view the molecular orbitals.

## Requirements

- JupyterLab >= 3.0
- JupyterLab >= 4.0

## Install

Expand Down
6 changes: 3 additions & 3 deletions binder/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ channels:

dependencies:
# runtime dependencies
- python >=3.8,<3.9.0a0
- jupyterlab >=3,<4.0.0a0
- python >=3.8,<3.13.0a0
- jupyterlab >=4,<5.0.0a0
# labextension build dependencies
- nodejs >=18,<19
- nodejs >=18,<21
- pip
- wheel
# additional packages for demos
Expand Down
35 changes: 20 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,44 +56,49 @@
"watch:labextension": "jupyter labextension watch ."
},
"dependencies": {
"@jupyterlab/application": "^3.6.1",
"@jupyterlab/filebrowser": "^3.6.1",
"@jupyterlab/launcher": "^3.6.1",
"@jupyterlab/settingregistry": "^3.6.1"
"@jupyterlab/application": "^4.0.0",
"@jupyterlab/filebrowser": "^4.0.0",
"@jupyterlab/launcher": "^4.0.0",
"@jupyterlab/settingregistry": "^4.0.0"
},
"devDependencies": {
"@babel/core": "^7.21.0",
"@babel/preset-env": "^7.20.2",
"@jupyterlab/builder": "^3.6.1",
"@jupyterlab/testutils": "^3.6.1",
"@material-ui/core": "4.12.4",
"@material-ui/icons": "4.11.3",
"@material-ui/lab": "4.0.0-alpha.61",
"@emotion/react": "^11.11.3",
"@emotion/styled": "^11.11.0",
"@jupyterlab/builder": "^4.0.0",
"@jupyterlab/testutils": "^4.0.0",
"@mui/icons-material": "5.15.10",
"@mui/material": "5.15.10",
"@playwright/test": "^1.31.2",
"@types/chroma-js": "^2.4.4",
"@types/jest": "^26.0.10",
"@types/signals": "1.0.4",
"@types/underscore": "^1.11.4",
"@typescript-eslint/eslint-plugin": "^5.54.1",
"@typescript-eslint/parser": "^5.54.1",
"eslint": "^8.36.0",
"eslint-config-prettier": "^8.7.0",
"eslint-plugin-prettier": "^4.2.1",
"jest": "^26.4.2",
"ngl": "2.0.0-dev.39",
"jest": "^29.7.0",
"ngl": "2.2.2",
"npm-run-all": "^4.1.5",
"prettier": "^2.8.4",
"react": "^17.0.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"rimraf": "^4.4.0",
"stylelint": "^14.3.0",
"stylelint-config-prettier": "^9.0.4",
"stylelint-config-recommended": "^6.0.0",
"stylelint-config-standard": "~24.0.0",
"stylelint-prettier": "^2.0.0",
"ts-jest": "^26.3.0",
"typescript": "~4.1.3",
"ts-jest": "^29.1.2",
"typescript": "~5.1.6",
"underscore": "^1.13.6"
},
"resolutions": {
"@types/react": "17.0.39"
"@types/react": "18.2.55",
"@types/react-dom": "18.2.19"
},
"sideEffects": [
"style/*.css",
Expand Down
9 changes: 5 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
[build-system]
requires = ["hatchling>=1.4.0", "jupyterlab>=3.4.7,<4.0.0", "hatch-nodejs-version"]
requires = ["hatchling>=1.5.0", "jupyterlab>=4.1.1,<5.0.0", "hatch-nodejs-version"]
build-backend = "hatchling.build"

[project]
name = "jupyterlab_mol_visualizer"
readme = "README.md"
license = { file = "LICENSE" }
requires-python = ">=3.7"
requires-python = ">=3.8"
classifiers = [
"Framework :: Jupyter",
"Framework :: Jupyter :: JupyterLab",
"Framework :: Jupyter :: JupyterLab :: 3",
"Framework :: Jupyter :: JupyterLab :: 4",
"Framework :: Jupyter :: JupyterLab :: Extensions",
"Framework :: Jupyter :: JupyterLab :: Extensions :: Prebuilt",
"License :: OSI Approved :: BSD License",
Expand All @@ -21,6 +21,7 @@ classifiers = [
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
dependencies = [
]
Expand Down Expand Up @@ -66,7 +67,7 @@ build_dir = "jupyterlab_mol_visualizer/labextension"
version_cmd = "hatch version"

[tool.jupyter-releaser.hooks]
before-build-npm = ["python -m pip install jupyterlab~=3.1", "jlpm", "jlpm build:prod"]
before-build-npm = ["python -m pip install jupyterlab~=4.1", "jlpm", "jlpm build:prod"]
before-build-python = ["jlpm clean:all"]

[tool.check-wheel-contents]
Expand Down
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { reactIcon } from '@jupyterlab/ui-components';

import { CounterWidget } from './widget';

import { IFileBrowserFactory } from '@jupyterlab/filebrowser';
import { IDefaultFileBrowser } from '@jupyterlab/filebrowser';

/**
* The command IDs used by the react-widget plugin.
Expand All @@ -26,11 +26,11 @@ namespace CommandIDs {
const extension: JupyterFrontEndPlugin<void> = {
id: 'react-widget',
autoStart: true,
optional: [ILauncher, IFileBrowserFactory],
optional: [ILauncher, IDefaultFileBrowser],
activate: (
app: JupyterFrontEnd,
launcher: ILauncher,
browserFactory: IFileBrowserFactory
browserFactory: IDefaultFileBrowser
) => {
const { commands } = app;

Expand Down
Loading
Loading