From 18fc170ca95667d476f1b1fef3efc7f663a55a61 Mon Sep 17 00:00:00 2001 From: martinRenou Date: Thu, 30 Apr 2026 16:03:41 +0200 Subject: [PATCH 1/7] Rename package jupyter-bluetooth-manager --- .copier-answers.yml | 4 +- .github/workflows/build.yml | 8 +-- .gitignore | 4 +- .prettierignore | 2 +- README.md | 10 ++-- RELEASE.md | 2 +- bluetooth_manager/__init__.py | 4 +- install.json | 4 +- package.json | 6 +-- pyproject.toml | 16 +++--- yarn.lock | 94 +++++++++++++++++------------------ 11 files changed, 77 insertions(+), 77 deletions(-) diff --git a/.copier-answers.yml b/.copier-answers.yml index 51d70f0..967e73f 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -6,10 +6,10 @@ author_name: Florence Haudin has_binder: false has_settings: true kind: frontend -labextension_name: bluetooth-manager +labextension_name: jupyter-bluetooth-manager project_short_description: A JupyterLab extension to manage to connect to devices with web bluetooth. -python_name: bluetooth_manager +python_name: jupyter-bluetooth-manager repository: https://github.com/QuantStack/bluetooth-manager test: true diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 54d3908..c5d1b5d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -50,13 +50,13 @@ jobs: pip install build python -m build - pip uninstall -y "bluetooth_manager" jupyterlab + pip uninstall -y "jupyter-bluetooth-manager" jupyterlab - name: Upload extension packages uses: actions/upload-artifact@v4 with: name: extension-artifacts - path: dist/bluetooth_manager* + path: dist/jupyter-bluetooth-manager* if-no-files-found: error test_isolated: @@ -79,7 +79,7 @@ jobs: sudo rm -rf $(which node) sudo rm -rf $(which node) - pip install "jupyterlab>=4.0.0,<5" bluetooth_manager*.whl + pip install "jupyterlab>=4.0.0,<5" jupyter-bluetooth-manager*.whl jupyter labextension list @@ -109,7 +109,7 @@ jobs: - name: Install the extension run: | set -eux - python -m pip install "jupyterlab>=4.0.0,<5" bluetooth_manager*.whl + python -m pip install "jupyterlab>=4.0.0,<5" jupyter-bluetooth-manager*.whl - name: Install dependencies working-directory: ui-tests diff --git a/.gitignore b/.gitignore index a977c79..11c3db5 100644 --- a/.gitignore +++ b/.gitignore @@ -7,9 +7,9 @@ node_modules/ *.egg-info/ .ipynb_checkpoints *.tsbuildinfo -bluetooth_manager/labextension +jupyter_bluetooth_manager/labextension # Version file is handled by hatchling -bluetooth_manager/_version.py +jupyter_bluetooth_manager/_version.py # Integration tests ui-tests/test-results/ diff --git a/.prettierignore b/.prettierignore index c70e013..692f03d 100644 --- a/.prettierignore +++ b/.prettierignore @@ -3,4 +3,4 @@ node_modules **/lib **/package.json !/package.json -bluetooth_manager +jupyter_bluetooth_manager diff --git a/README.md b/README.md index 88d42d7..eaafd07 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# bluetooth_manager +# jupyter-bluetooth-manager A JupyterLab extension to manage to connect to devices with web bluetooth. @@ -11,7 +11,7 @@ A JupyterLab extension to manage to connect to devices with web bluetooth. To install the extension, execute: ```bash -pip install bluetooth_manager +pip install jupyter-bluetooth-manager ``` ## Uninstall @@ -19,7 +19,7 @@ pip install bluetooth_manager To remove the extension, execute: ```bash -pip uninstall bluetooth_manager +pip uninstall jupyter-bluetooth-manager ``` ## Contributing @@ -34,7 +34,7 @@ The `jlpm` command is JupyterLab's pinned version of ```bash # Clone the repo to your local environment -# Change directory to the bluetooth_manager directory +# Change directory to the jupyter-bluetooth-manager directory # Install package in development mode pip install -e "." # Link your development version of the extension with JupyterLab @@ -63,7 +63,7 @@ jupyter lab build --minimize=False ### Development uninstall ```bash -pip uninstall bluetooth_manager +pip uninstall jupyter-bluetooth-manager ``` In development mode, you will also need to remove the symlink created by `jupyter labextension develop` diff --git a/RELEASE.md b/RELEASE.md index bc771f4..164a35a 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -1,4 +1,4 @@ -# Making a new release of bluetooth_manager +# Making a new release of jupyter-bluetooth-manager The extension can be published to `PyPI` and `npm` manually or using the [Jupyter Releaser](https://github.com/jupyter-server/jupyter_releaser). diff --git a/bluetooth_manager/__init__.py b/bluetooth_manager/__init__.py index 7b8753f..828a887 100644 --- a/bluetooth_manager/__init__.py +++ b/bluetooth_manager/__init__.py @@ -7,12 +7,12 @@ # in editable mode with pip. It is highly recommended to install # the package from a stable release or in editable mode: https://pip.pypa.io/en/stable/topics/local-project-installs/#editable-installs import warnings - warnings.warn("Importing 'bluetooth_manager' outside a proper installation.") + warnings.warn("Importing 'jupyter_bluetooth_manager' outside a proper installation.") __version__ = "dev" def _jupyter_labextension_paths(): return [{ "src": "labextension", - "dest": "bluetooth-manager" + "dest": "jupyter-bluetooth-manager" }] diff --git a/install.json b/install.json index 57a1ba2..c462436 100644 --- a/install.json +++ b/install.json @@ -1,5 +1,5 @@ { "packageManager": "python", - "packageName": "bluetooth_manager", - "uninstallInstructions": "Use your Python package manager (pip, conda, etc.) to uninstall the package bluetooth_manager" + "packageName": "jupyter-bluetooth-manager", + "uninstallInstructions": "Use your Python package manager (pip, conda, etc.) to uninstall the package jupyter-bluetooth-manager" } diff --git a/package.json b/package.json index 17e1e2a..cbcea09 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "bluetooth-manager", + "name": "jupyter-bluetooth-manager", "version": "0.1.0", "description": "A JupyterLab extension to manage to connect to devices with web bluetooth.", "keywords": [ @@ -39,7 +39,7 @@ "clean": "jlpm clean:lib", "clean:lib": "rimraf lib tsconfig.tsbuildinfo", "clean:lintcache": "rimraf .eslintcache .stylelintcache", - "clean:labextension": "rimraf bluetooth_manager/labextension bluetooth_manager/_version.py", + "clean:labextension": "rimraf jupyter_bluetooth_manager/labextension jupyter_bluetooth_manager/_version.py", "clean:all": "jlpm clean:lib && jlpm clean:labextension && jlpm clean:lintcache", "eslint": "jlpm eslint:check --fix", "eslint:check": "eslint . --cache --ext .ts,.tsx", @@ -110,7 +110,7 @@ }, "jupyterlab": { "extension": true, - "outputDir": "bluetooth_manager/labextension", + "outputDir": "jupyter_bluetooth_manager/labextension", "schemaDir": "schema" }, "eslintIgnore": [ diff --git a/pyproject.toml b/pyproject.toml index 9566923..f74956f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ requires = ["hatchling>=1.5.0", "jupyterlab>=4.0.0,<5", "hatch-nodejs-version>=0 build-backend = "hatchling.build" [project] -name = "bluetooth_manager" +name = "jupyter-bluetooth-manager" readme = "README.md" license = { file = "LICENSE" } requires-python = ">=3.8" @@ -33,24 +33,24 @@ source = "nodejs" fields = ["description", "authors", "urls", "keywords"] [tool.hatch.build.targets.sdist] -artifacts = ["bluetooth_manager/labextension"] +artifacts = ["jupyter_bluetooth_manager/labextension"] exclude = [".github"] [tool.hatch.build.targets.wheel.shared-data] -"bluetooth_manager/labextension" = "share/jupyter/labextensions/bluetooth-manager" +"jupyter_bluetooth_manager/labextension" = "share/jupyter/labextensions/bluetooth-manager" "install.json" = "share/jupyter/labextensions/bluetooth-manager/install.json" [tool.hatch.build.hooks.version] -path = "bluetooth_manager/_version.py" +path = "jupyter_bluetooth_manager/_version.py" [tool.hatch.build.hooks.jupyter-builder] dependencies = ["hatch-jupyter-builder>=0.5"] build-function = "hatch_jupyter_builder.npm_builder" ensured-targets = [ - "bluetooth_manager/labextension/static/style.js", - "bluetooth_manager/labextension/package.json", + "jupyter_bluetooth_manager/labextension/static/style.js", + "jupyter_bluetooth_manager/labextension/package.json", ] -skip-if-exists = ["bluetooth_manager/labextension/static/style.js"] +skip-if-exists = ["jupyter_bluetooth_manager/labextension/static/style.js"] [tool.hatch.build.hooks.jupyter-builder.build-kwargs] build_cmd = "build:prod" @@ -60,7 +60,7 @@ npm = ["jlpm"] build_cmd = "install:extension" npm = ["jlpm"] source_dir = "src" -build_dir = "bluetooth_manager/labextension" +build_dir = "jupyter_bluetooth_manager/labextension" [tool.jupyter-releaser.options] version_cmd = "hatch version" diff --git a/yarn.lock b/yarn.lock index 2cc81ef..a0e7da3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4604,53 +4604,6 @@ __metadata: languageName: node linkType: hard -"bluetooth-manager@workspace:.": - version: 0.0.0-use.local - resolution: "bluetooth-manager@workspace:." - dependencies: - "@emotion/react": ^11.9.0 - "@emotion/styled": ^11.9.0 - "@jupyter-widgets/base": ^1.1.10 || ^2 || ^3 || ^4 || ^5 || ^6 - "@jupyterlab/application": ^4.3.1 - "@jupyterlab/builder": ^4.3.1 - "@jupyterlab/running": ^4.3.1 - "@jupyterlab/settingregistry": ^4.3.1 - "@jupyterlab/testutils": ^4.3.1 - "@jupyterlab/ui-components": ^4.3.1 - "@mui/icons-material": 6.1.1 - "@types/jest": ^29.2.0 - "@types/json-schema": ^7.0.11 - "@types/react": ^18.0.26 - "@types/react-addons-linked-state-mixin": ^0.14.22 - "@types/web-bluetooth": ^0.0.7 - "@typescript-eslint/eslint-plugin": ^6.1.0 - "@typescript-eslint/parser": ^6.1.0 - base64-js: ^1.5.1 - css-loader: ^6.7.1 - eslint: ^8.36.0 - eslint-config-prettier: ^8.8.0 - eslint-plugin-prettier: ^5.0.0 - ieee754: ^1.2.1 - jest: ^29.2.0 - npm-run-all: ^4.1.5 - prettier: ^3.0.0 - react: ^18.0.0 - react-battery-gauge: 1.0.7 - react-dom: ^18.0.0 - react-select: 5.9.0 - rimraf: ^5.0.1 - source-map-loader: ^1.0.2 - style-loader: ^3.3.1 - stylelint: ^15.10.1 - stylelint-config-recommended: ^13.0.0 - stylelint-config-standard: ^34.0.0 - stylelint-csstree-validator: ^3.0.0 - stylelint-prettier: ^4.0.0 - typescript: ~5.0.2 - yjs: ^13.5.0 - languageName: unknown - linkType: soft - "brace-expansion@npm:^1.1.7": version: 1.1.11 resolution: "brace-expansion@npm:1.1.11" @@ -7833,6 +7786,53 @@ __metadata: languageName: node linkType: hard +"jupyter-bluetooth-manager@workspace:.": + version: 0.0.0-use.local + resolution: "jupyter-bluetooth-manager@workspace:." + dependencies: + "@emotion/react": ^11.9.0 + "@emotion/styled": ^11.9.0 + "@jupyter-widgets/base": ^1.1.10 || ^2 || ^3 || ^4 || ^5 || ^6 + "@jupyterlab/application": ^4.3.1 + "@jupyterlab/builder": ^4.3.1 + "@jupyterlab/running": ^4.3.1 + "@jupyterlab/settingregistry": ^4.3.1 + "@jupyterlab/testutils": ^4.3.1 + "@jupyterlab/ui-components": ^4.3.1 + "@mui/icons-material": 6.1.1 + "@types/jest": ^29.2.0 + "@types/json-schema": ^7.0.11 + "@types/react": ^18.0.26 + "@types/react-addons-linked-state-mixin": ^0.14.22 + "@types/web-bluetooth": ^0.0.7 + "@typescript-eslint/eslint-plugin": ^6.1.0 + "@typescript-eslint/parser": ^6.1.0 + base64-js: ^1.5.1 + css-loader: ^6.7.1 + eslint: ^8.36.0 + eslint-config-prettier: ^8.8.0 + eslint-plugin-prettier: ^5.0.0 + ieee754: ^1.2.1 + jest: ^29.2.0 + npm-run-all: ^4.1.5 + prettier: ^3.0.0 + react: ^18.0.0 + react-battery-gauge: 1.0.7 + react-dom: ^18.0.0 + react-select: 5.9.0 + rimraf: ^5.0.1 + source-map-loader: ^1.0.2 + style-loader: ^3.3.1 + stylelint: ^15.10.1 + stylelint-config-recommended: ^13.0.0 + stylelint-config-standard: ^34.0.0 + stylelint-csstree-validator: ^3.0.0 + stylelint-prettier: ^4.0.0 + typescript: ~5.0.2 + yjs: ^13.5.0 + languageName: unknown + linkType: soft + "keyv@npm:^4.5.3": version: 4.5.4 resolution: "keyv@npm:4.5.4" From d856768b666dccf7b347aed0d8deabc3b39d3f37 Mon Sep 17 00:00:00 2001 From: martinRenou Date: Thu, 30 Apr 2026 16:13:23 +0200 Subject: [PATCH 2/7] Rename module --- {bluetooth_manager => jupyter_bluetooth_manager}/__init__.py | 0 {bluetooth_manager => jupyter_bluetooth_manager}/_frontend.py | 0 {bluetooth_manager => jupyter_bluetooth_manager}/movehub.py | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename {bluetooth_manager => jupyter_bluetooth_manager}/__init__.py (100%) rename {bluetooth_manager => jupyter_bluetooth_manager}/_frontend.py (100%) rename {bluetooth_manager => jupyter_bluetooth_manager}/movehub.py (100%) diff --git a/bluetooth_manager/__init__.py b/jupyter_bluetooth_manager/__init__.py similarity index 100% rename from bluetooth_manager/__init__.py rename to jupyter_bluetooth_manager/__init__.py diff --git a/bluetooth_manager/_frontend.py b/jupyter_bluetooth_manager/_frontend.py similarity index 100% rename from bluetooth_manager/_frontend.py rename to jupyter_bluetooth_manager/_frontend.py diff --git a/bluetooth_manager/movehub.py b/jupyter_bluetooth_manager/movehub.py similarity index 100% rename from bluetooth_manager/movehub.py rename to jupyter_bluetooth_manager/movehub.py From c6aebb3e6104b1c1169b377f847c3e9fe361bfe7 Mon Sep 17 00:00:00 2001 From: martinRenou Date: Thu, 30 Apr 2026 16:17:02 +0200 Subject: [PATCH 3/7] Fix import --- examples/test-widget-with-ipykernel.ipynb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/test-widget-with-ipykernel.ipynb b/examples/test-widget-with-ipykernel.ipynb index 09de47c..5926e49 100644 --- a/examples/test-widget-with-ipykernel.ipynb +++ b/examples/test-widget-with-ipykernel.ipynb @@ -15,21 +15,21 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": null, "id": "762d552a-dafd-4b4b-9b0c-8b6612d2415b", "metadata": { "scrolled": true }, "outputs": [], "source": [ - "import asyncio \n", - "from bluetooth_manager import MoveHubWidget,LedColor,Port, Sensor\n", + "import asyncio\n", + "from jupyter_bluetooth_manager import MoveHubWidget,LedColor,Port, Sensor\n", "from ipywidgets import Output\n", "from IPython.display import display\n", "\n", "# the robot's LED supports the following colors\n", "colors = [\n", - " \n", + "\n", " LedColor.pink,\n", " LedColor.purple,\n", " LedColor.blue,\n", @@ -53,7 +53,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": null, "id": "aae633ad-bbb2-45c2-a1ff-5fab18146172", "metadata": { "scrolled": true @@ -76,7 +76,7 @@ ], "source": [ "# number of concurrent \"lanes\"\n", - "n_lanes = 4 \n", + "n_lanes = 4\n", "widget = MoveHubWidget(n_lanes=n_lanes)\n", "output = Output()\n", "display(widget)" @@ -179,13 +179,13 @@ "d_forward = 200\n", "d_rotate = 300\n", "output = Output()\n", - "async def main(lane,log, identifier): \n", + "async def main(lane,log, identifier):\n", " for i in range(4):\n", " await lane.set_led_async(\"red\")\n", " await lane.motor_angle_multi_async(angle=d_forward, power_a=speed,power_b=speed)\n", " await lane.set_led_async(\"green\")\n", " await lane.motor_angle_multi_async(angle=d_rotate, power_a=speed,power_b=-1.0*speed)\n", - " \n", + "\n", "widget.run_async_program(main, output=output);\n", "output" ] From 9ebc1ded7222bb73a879ba1d2a058afb81bdde2a Mon Sep 17 00:00:00 2001 From: martinRenou Date: Thu, 30 Apr 2026 16:25:04 +0200 Subject: [PATCH 4/7] Some missing renames --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index f74956f..87215c0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,8 +37,8 @@ artifacts = ["jupyter_bluetooth_manager/labextension"] exclude = [".github"] [tool.hatch.build.targets.wheel.shared-data] -"jupyter_bluetooth_manager/labextension" = "share/jupyter/labextensions/bluetooth-manager" -"install.json" = "share/jupyter/labextensions/bluetooth-manager/install.json" +"jupyter_bluetooth_manager/labextension" = "share/jupyter/labextensions/jupyter-bluetooth-manager" +"install.json" = "share/jupyter/labextensions/jupyter-bluetooth-manager/install.json" [tool.hatch.build.hooks.version] path = "jupyter_bluetooth_manager/_version.py" From 8457e0c5902228673a3f236a53736400133984ca Mon Sep 17 00:00:00 2001 From: martinRenou Date: Thu, 30 Apr 2026 16:30:43 +0200 Subject: [PATCH 5/7] Some renames + fix artifact --- .github/workflows/build.yml | 2 +- schema/plugin.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c5d1b5d..6edb421 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -56,7 +56,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: extension-artifacts - path: dist/jupyter-bluetooth-manager* + path: dist/* if-no-files-found: error test_isolated: diff --git a/schema/plugin.json b/schema/plugin.json index d50722f..c534cae 100644 --- a/schema/plugin.json +++ b/schema/plugin.json @@ -1,7 +1,7 @@ { "jupyter.lab.shortcuts": [], - "title": "bluetooth-manager", - "description": "bluetooth-manager settings.", + "title": "jupyter-bluetooth-manager", + "description": "jupyter-bluetooth-manager settings.", "type": "object", "properties": {}, "additionalProperties": false From 5c162e60f1cd186735c7d4a99396b7b8babb7019 Mon Sep 17 00:00:00 2001 From: martinRenou Date: Thu, 30 Apr 2026 16:36:21 +0200 Subject: [PATCH 6/7] Fixup --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6edb421..e7a99d5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -79,7 +79,7 @@ jobs: sudo rm -rf $(which node) sudo rm -rf $(which node) - pip install "jupyterlab>=4.0.0,<5" jupyter-bluetooth-manager*.whl + pip install "jupyterlab>=4.0.0,<5" jupyter_bluetooth_manager*.whl jupyter labextension list @@ -109,7 +109,7 @@ jobs: - name: Install the extension run: | set -eux - python -m pip install "jupyterlab>=4.0.0,<5" jupyter-bluetooth-manager*.whl + python -m pip install "jupyterlab>=4.0.0,<5" jupyter_bluetooth_manager*.whl - name: Install dependencies working-directory: ui-tests From 8d1e9d292c3c561d2d9e5ae644ecea2dc0d8f145 Mon Sep 17 00:00:00 2001 From: martinRenou Date: Thu, 30 Apr 2026 16:37:24 +0200 Subject: [PATCH 7/7] Fix --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e7a99d5..5a613af 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -56,7 +56,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: extension-artifacts - path: dist/* + path: dist/jupyter_bluetooth_manager* if-no-files-found: error test_isolated: