From 8c3c0b1e13a289a4dabe24122b5513ae500cf2b8 Mon Sep 17 00:00:00 2001 From: Maurice Lam Date: Wed, 20 Sep 2023 12:28:55 -0700 Subject: [PATCH 1/3] Make cryptography a valid dependency for emscripten targets Since only the special cryptography package bundled with pyodide can be used, relax the version requirement to anything that's version 39.*. Fix #284 --- setup.cfg | 2 +- web/bumble.js | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/setup.cfg b/setup.cfg index 191f4e9..e61ebd9 100644 --- a/setup.cfg +++ b/setup.cfg @@ -35,7 +35,7 @@ install_requires = appdirs >= 1.4; platform_system!='Emscripten' bt-test-interfaces >= 0.0.2; platform_system!='Emscripten' click == 8.1.3; platform_system!='Emscripten' - cryptography == 39; platform_system!='Emscripten' + cryptography == 39.* grpcio == 1.57.0; platform_system!='Emscripten' humanize >= 4.6.0; platform_system!='Emscripten' libusb1 >= 2.0.1; platform_system!='Emscripten' diff --git a/web/bumble.js b/web/bumble.js index c5fd6a3..b1243a5 100644 --- a/web/bumble.js +++ b/web/bumble.js @@ -74,7 +74,6 @@ export async function loadBumble(pyodide, bumblePackage) { await pyodide.loadPackage("micropip"); await pyodide.runPythonAsync(` import micropip - await micropip.install("cryptography") await micropip.install("${bumblePackage}") package_list = micropip.list() print(package_list) From 7c1a3bb8f990f45f411f12b132418f261af42754 Mon Sep 17 00:00:00 2001 From: Maurice Lam Date: Wed, 20 Sep 2023 18:03:35 -0700 Subject: [PATCH 2/3] Separate version specifier for cryptography in Emscripten builds --- setup.cfg | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index e61ebd9..a589b9b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -35,7 +35,11 @@ install_requires = appdirs >= 1.4; platform_system!='Emscripten' bt-test-interfaces >= 0.0.2; platform_system!='Emscripten' click == 8.1.3; platform_system!='Emscripten' - cryptography == 39.* + cryptography == 39; platform_system!='Emscripten' + # Pyodide has bundles a version of cryptography that is built for wasm, which may not match the + # versions available on PyPI. Relax the version requirement since it's better than being + # completely unable to import the package in case of version mismatch. + cryptography >= 39.0; platform_system=='Emscripten' grpcio == 1.57.0; platform_system!='Emscripten' humanize >= 4.6.0; platform_system!='Emscripten' libusb1 >= 2.0.1; platform_system!='Emscripten' From 772c188674ff8ab0c6ed49760dc602f94b3a94e6 Mon Sep 17 00:00:00 2001 From: Maurice Lam Date: Mon, 25 Sep 2023 18:08:52 -0700 Subject: [PATCH 3/3] Fix typo --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index a589b9b..1ca73c7 100644 --- a/setup.cfg +++ b/setup.cfg @@ -36,7 +36,7 @@ install_requires = bt-test-interfaces >= 0.0.2; platform_system!='Emscripten' click == 8.1.3; platform_system!='Emscripten' cryptography == 39; platform_system!='Emscripten' - # Pyodide has bundles a version of cryptography that is built for wasm, which may not match the + # Pyodide bundles a version of cryptography that is built for wasm, which may not match the # versions available on PyPI. Relax the version requirement since it's better than being # completely unable to import the package in case of version mismatch. cryptography >= 39.0; platform_system=='Emscripten'