Jupyterlab 插件模板
根据改项目模板创建 jupyterlab 插件,从 官方插件模板 修改而来。
环境
使用 conda 创建或激活现有虚拟环境
# 创建虚拟环境
conda create -n dev --override-channels --strict-channel-priority -c conda-forge -c nodefaults jupyterlab==3.2.5 jupyter-packaging
# 激活虚拟环境
conda activate dev
安装
pip install cookiecutter
使用
cookiecutter http://gitlab.dfc.com:8091/zhangzhipeng/extension-cookiecutter-ts.git
交互选项
- kind
- frontend 前端插件
- server 前后端插件
- theme 主题插件
- author_name 作者姓名
- author_email 作者邮箱
- labextension_name 插件名称
- python_name 作为 python 插件时的名称
- project_short_description 插件简短描述
- vue 是否启用 vue
- sass 是否启用 sass
- has_settings 是否启用用户设置 json 配置文件
- has_binder 是否设置 binder
- test 是否需要测试模块
- repository 版本控制仓库地址
安装项目
pip install -e .
构建项目
jlpm run build
建立软链接
热更新开发需要用到这个
# 建立软链接需要用到高于3.2.5版本的jupyterlab
pip install jupyterlab==3.6.1
# 建立软链接
jupyter labextension develop --overwrite .
# 切回3.2.5版本的jupyterlab,因为目前客户的jupyterlab版本为3.2.5
pip install jupyterlab==3.2.5
热更新
jlpm run watch
打包
jlpm python-build
安装
pip uninstall jupyterlab_widget_s3
pip install jupyterlab_widget_s3-0.1.0-py3-node-any.whl
关于 Vue 项目的样式的问题
目前 vue-style-loader 引入后也不生效,不知道什么原因,所以需要将样式文件独立出来,都引入到 style/index.js 中!
具体参考 jupyterlab的vue插件示例
Metadata
Release files for jupyterlab-widget-s3 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| jupyterlab_widget_s3-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Release files / jupyterlab_widget_s3-0.1.0-py3-none-any.whl
| Download URL | jupyterlab_widget_s3-0.1.0-py3-none-any.whl |
|---|---|
| Size | 520.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
23d351d4b968d64604ee3a45d050f3ae31d41594f8c10f4e2a618d9b85d9e978
|
|
BLAKE2b-256 checksum How to use checksums |
2256dcb4f09382d0ab66c54ad2a747d582277f8eff32aebba4abd329a5f50910
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.7
|