Skip to content

Commit

Permalink
Update ipywidgets 8
Browse files Browse the repository at this point in the history
  • Loading branch information
martinRenou committed Apr 25, 2022
1 parent 1d2eb69 commit cf9485c
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 35 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Expand Up @@ -47,7 +47,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install -U pip setuptools cookiecutter
python -m pip install -U pip setuptools cookiecutter jupyterlab jupyter_packaging==0.7.9 ipywidgets==8.0.0rc0
- name: Test the extension
run: |
Expand Down
7 changes: 6 additions & 1 deletion README.md
Expand Up @@ -65,7 +65,6 @@ notebook / lab frontend. For lab, this is done by the command:

```
jupyter labextension develop --overwrite .
yarn run build
```

For classic notebook, you can run:
Expand All @@ -80,6 +79,12 @@ the `install` command every time that you rebuild your extension. For certain in
you might also need another flag instead of `--sys-prefix`, but we won't cover the meaning
of those flags here.

Every time you make a change in the TypeScript code, you will need to rebuild it then refresh the browser page:

```
yarn run build
```


### How to see your changes
#### Typescript:
Expand Down
1 change: 0 additions & 1 deletion {{cookiecutter.github_project_name}}/.gitignore
Expand Up @@ -146,7 +146,6 @@ $RECYCLE.BIN/

**/node_modules/
{{ cookiecutter.python_package_name }}/nbextension/index.*
{{ cookiecutter.python_package_name }}/labextension/*.tgz

# Coverage data
# -------------
Expand Down
22 changes: 19 additions & 3 deletions {{cookiecutter.github_project_name}}/examples/introduction.ipynb
Expand Up @@ -34,11 +34,20 @@
"source": [
"assert w.value == 'Hello World'"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"w"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -52,9 +61,16 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.3"
"version": "3.10.4"
},
"widgets": {
"application/vnd.jupyter.widget-state+json": {
"state": {},
"version_major": 2,
"version_minor": 0
}
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
7 changes: 3 additions & 4 deletions {{cookiecutter.github_project_name}}/package.json
Expand Up @@ -37,7 +37,6 @@
"build:nbextension": "webpack",
"clean": "yarn run clean:lib && yarn run clean:nbextension && yarn run clean:labextension",
"clean:lib": "rimraf lib",
"clean:labextension": "rimraf {{ cookiecutter.python_package_name }}/labextension",
"clean:nbextension": "rimraf {{ cookiecutter.python_package_name }}/nbextension/static/index.js",
"lint": "eslint . --ext .ts,.tsx --fix",
"lint:check": "eslint . --ext .ts,.tsx",
Expand All @@ -49,14 +48,14 @@
"watch:labextension": "jupyter labextension watch ."
},
"dependencies": {
"@jupyter-widgets/base": "^1.1.10 || ^2.0.0 || ^3.0.0 || ^4.0.0"
"@jupyter-widgets/base": "^1.1.10 || ^2 || ^3 || ^4 || ^5 || ^6"
},
"devDependencies": {
"@babel/core": "^7.5.0",
"@babel/preset-env": "^7.5.0",
"@jupyterlab/builder": "^3.0.0",
"@phosphor/application": "^1.6.0",
"@phosphor/widgets": "^1.6.0",
"@lumino/application": "^1.6.0",
"@lumino/widgets": "^1.6.0",
"@types/jest": "^26.0.0",
"@types/webpack-env": "^1.13.6",
"@typescript-eslint/eslint-plugin": "^3.6.0",
Expand Down
42 changes: 21 additions & 21 deletions {{cookiecutter.github_project_name}}/setup.py
Expand Up @@ -54,7 +54,6 @@
('etc/jupyter/nbconfig/notebook.d', '.', '{{ cookiecutter.python_package_name }}.json'),
]


cmdclass = create_cmdclass('jsdeps', package_data_spec=package_data_spec,
data_files_spec=data_files_spec)
npm_install = combine_commands(
Expand All @@ -65,36 +64,37 @@


setup_args = dict(
name = name,
description = '{{ cookiecutter.project_short_description }}',
version = version,
scripts = glob(pjoin('scripts', '*')),
cmdclass = cmdclass,
packages = find_packages(),
author = '{{ cookiecutter.author_name }}',
author_email = '{{ cookiecutter.author_email }}',
url = 'https://github.com/{{ cookiecutter.github_organization_name }}/{{ cookiecutter.github_project_name }}',
license = 'BSD',
platforms = "Linux, Mac OS X, Windows",
keywords = ['Jupyter', 'Widgets', 'IPython'],
classifiers = [
name=name,
description='{{ cookiecutter.project_short_description }}',
version=version,
scripts=glob(pjoin('scripts', '*')),
cmdclass=cmdclass,
packages=find_packages(),
author='{{ cookiecutter.author_name }}',
author_email='{{ cookiecutter.author_email }}',
url='https://github.com/{{ cookiecutter.github_organization_name }}/{{ cookiecutter.github_project_name }}',
license='BSD',
platforms="Linux, Mac OS X, Windows",
keywords=['Jupyter', 'Widgets', 'IPython'],
classifiers=[
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Framework :: Jupyter',
],
include_package_data = True,
include_package_data=True,
python_requires=">=3.6",
install_requires = [
'ipywidgets>=7.0.0',
install_requires=[
'ipywidgets>=7.0.0,<9',
],
extras_require = {
extras_require={
'test': [
'pytest>=4.6',
'pytest-cov',
Expand All @@ -114,7 +114,7 @@
'sphinx_rtd_theme',
],
},
entry_points = {
entry_points={
},
)

Expand Down
4 changes: 2 additions & 2 deletions {{cookiecutter.github_project_name}}/src/plugin.ts
@@ -1,9 +1,9 @@
// Copyright (c) {{ cookiecutter.author_name }}
// Distributed under the terms of the Modified BSD License.

import { Application, IPlugin } from '@phosphor/application';
import { Application, IPlugin } from '@lumino/application';

import { Widget } from '@phosphor/widgets';
import { Widget } from '@lumino/widgets';

import { IJupyterWidgetRegistry } from '@jupyter-widgets/base';

Expand Down
Expand Up @@ -4,8 +4,9 @@
# Copyright (c) {{ cookiecutter.author_name }}.
# Distributed under the terms of the Modified BSD License.

from .example import ExampleWidget
from ._version import __version__, version_info
from .example import ExampleWidget # noqa
from ._version import __version__, version_info # noqa


def _jupyter_labextension_paths():
"""Called by Jupyter Lab Server to detect if it is a valid labextension and
Expand Down

0 comments on commit cf9485c

Please sign in to comment.