From 1be1e4258a710e93541d69423e39095901ea6139 Mon Sep 17 00:00:00 2001 From: Tom van Woudenberg Date: Wed, 30 Oct 2024 12:22:09 +0100 Subject: [PATCH 1/3] added how to do wheels --- book/features/live_code.ipynb | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/book/features/live_code.ipynb b/book/features/live_code.ipynb index a2dfb95..64f43d2 100644 --- a/book/features/live_code.ipynb +++ b/book/features/live_code.ipynb @@ -128,7 +128,22 @@ "\n", "```python\n", "%pip install package_name\n", - "```\n" + "```\n", + "\n", + "If you have some custom packages you can also create a wheel to import. Therefore, create a wheel from your package by running this in the root directoy of your package: \n", + "\n", + "```\n", + "python setup.py bdist_wheel\n", + "```\n", + "\n", + "Copy the wheel from `dist/.whl` to your book and import the package from within a notebook using:\n", + "\n", + "```python\n", + "import micropip\n", + "await micropip.install('/.whl')\n", + "```\n", + "\n", + "Preferably with the tag `thebe-remove-input-init`." ] }, { From 68114e395f0d57704d046436d5c82f1041c41616 Mon Sep 17 00:00:00 2001 From: Tom van Woudenberg Date: Wed, 30 Oct 2024 12:23:02 +0100 Subject: [PATCH 2/3] Update live_code.ipynb --- book/features/live_code.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/features/live_code.ipynb b/book/features/live_code.ipynb index 64f43d2..6e33f52 100644 --- a/book/features/live_code.ipynb +++ b/book/features/live_code.ipynb @@ -132,7 +132,7 @@ "\n", "If you have some custom packages you can also create a wheel to import. Therefore, create a wheel from your package by running this in the root directoy of your package: \n", "\n", - "```\n", + "```shell\n", "python setup.py bdist_wheel\n", "```\n", "\n", From 57a6e8ad7caad7edbc5c0ca1818858bb189c5603 Mon Sep 17 00:00:00 2001 From: Tom van Woudenberg Date: Wed, 30 Oct 2024 12:26:29 +0100 Subject: [PATCH 3/3] Update live_code.ipynb --- book/features/live_code.ipynb | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/book/features/live_code.ipynb b/book/features/live_code.ipynb index 6e33f52..ff42ea6 100644 --- a/book/features/live_code.ipynb +++ b/book/features/live_code.ipynb @@ -124,12 +124,7 @@ "\n", "This will install the packages: Micropip will look at the Pyodide package index, but also at the general PyPi index. If a package is pure python (i.e. no C extensions), then it can also be used by Pyodide.\n", "\n", - "If the packages are not included in Pyodide, you can use `pip:\n", - "\n", - "```python\n", - "%pip install package_name\n", - "```\n", - "\n", + "### Custom packages\n", "If you have some custom packages you can also create a wheel to import. Therefore, create a wheel from your package by running this in the root directoy of your package: \n", "\n", "```shell\n", @@ -143,7 +138,14 @@ "await micropip.install('/.whl')\n", "```\n", "\n", - "Preferably with the tag `thebe-remove-input-init`." + "Preferably with the tag `thebe-remove-input-init`.\n", + "\n", + "### Other packages not in Pyodide but on PyPI\n", + "If the packages are not included in Pyodide, you can use `pip:\n", + "\n", + "```python\n", + "%pip install package_name\n", + "```" ] }, {