一个将笔记本交互数据发送到后端的JupyterLab扩展。
项目描述
Unianalytics Telemetry JupyterLab扩展
JupyterLab扩展,收集用户数据并将其发送到后端。
需求
- JupyterLab >= 3.1.0
安装
要安装扩展,请执行
pip install jupyterlab-unianalytics-telemetry
卸载
要删除扩展,请执行
pip uninstall jupyterlab-unianalytics-telemetry
故障排除
如果您看到前端扩展,但它不起作用,请检查服务器扩展是否已启用
jupyter server extension list
如果服务器扩展已安装并启用,但您看不到前端扩展,请检查前端扩展是否已安装
jupyter labextension list
贡献
开发安装
注意:您将需要NodeJS来构建扩展包。
《jlpm》命令是JupyterLab中安装的yarn的固定版本,您可以使用《jlpm》或《yarn》或《npm》代替。
# Clone the repo to your local environment
# Change directory to the jupyterlab_unianalytics_telemetry directory
# Install package in development mode
pip install -e ".[test]"
# Link your development version of the extension with JupyterLab
jupyter labextension develop . --overwrite
# Server extension must be manually installed in develop mode
jupyter server extension enable jupyterlab_unianalytics_telemetry
# Rebuild extension Typescript source after making changes
jlpm build
您可以在不同的终端同时监视源目录并运行JupyterLab,以监视扩展源代码的变化并自动重新构建扩展。
# Watch the source directory in one terminal, automatically rebuilding when needed
jlpm watch
# Run JupyterLab in another terminal
jupyter lab
当监视命令运行时,每次保存的更改都将立即在本地构建并可供运行的JupyterLab使用。刷新JupyterLab以在浏览器中加载更改(您可能需要等待几秒钟,以便扩展重新构建)。
默认情况下,《jlpm build》命令为此扩展生成源映射,以使使用浏览器开发者工具进行调试更容易。要为JupyterLab核心扩展也生成源映射,请运行以下命令
jupyter lab build --minimize=False
开发卸载
# Server extension must be manually disabled in develop mode
jupyter server extension disable jupyterlab_unianalytics_telemetry
pip uninstall jupyterlab_unianalytics_telemetry
在开发模式下,您还需要删除由《jupyter labextension develop》命令创建的符号链接。要找到其位置,您可以运行《jupyter labextension list》以确定《labextensions》文件夹的位置。然后您可以在该文件夹中删除名为《jupyterlab_unianalytics_telemetry》的符号链接。
测试扩展
服务器测试
此扩展使用Pytest进行Python代码测试。
安装测试依赖项(只需安装一次)
pip install -e ".[test]"
# Each time you install the Python package, you need to restore the front-end extension link
jupyter labextension develop . --overwrite
要执行它们,请运行
pytest -vv -r ap --cov jupyterlab_unianalytics_telemetry
前端测试
此扩展使用Jest进行JavaScript代码测试。
要执行它们,请执行
jlpm
jlpm test
集成测试
此扩展使用Playwright进行集成测试(也称为用户级测试)。更确切地说,JupyterLab助手Galata用于处理在JupyterLab中测试扩展。
更多详细信息请参阅ui-tests的README。
打包扩展
项目详情
jupyterlab_unianalytics_telemetry-4.0.14.tar.gz的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 48eede8adf33e5bcef99376880b9a19f529eca10c3e0ee3caf029b28e749d031 |
|
MD5 | f2dd889dd7417a2d64e8fe790ad9fc45 |
|
BLAKE2b-256 | c4eeed03e9b86b04895b64ebd45684460d29cb1bc65aa406f5d71143481fdd7f |
哈希值 for jupyterlab_unianalytics_telemetry-4.0.14-py3-none-any.whl
算法 | 哈希摘要 | |
---|---|---|
SHA256 | c25f7e524cf940a541d27cbd47ff4e1fa4ca3c5deadd0c601c9a871bb03722e1 |
|
MD5 | 9c602cb405a20da44afcce6d1af23274 |
|
BLAKE2b-256 | 73f1f39902d6785806f17ee7fc57cc1a4eb497aad886ec5f9c4540e1e27bb081 |