aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGilles Boccon-Gibod <boccongibod@google.com>2023-09-25 19:29:09 -0700
committerGitHub <noreply@github.com>2023-09-25 19:29:09 -0700
commitc12dee4e76b41f1eb2ab0410c1f90cf4536cbe3e (patch)
tree05300e30821962834cea766469352d1efc9cf4dd
parent4c29a1627132df3f6ff0bc0c549db46ad50d459c (diff)
parent772c188674ff8ab0c6ed49760dc602f94b3a94e6 (diff)
downloadbumble-c12dee4e76b41f1eb2ab0410c1f90cf4536cbe3e.tar.gz
Merge pull request #294 from mauricelam/wasm-cryptography
Make cryptography a valid dependency for emscripten targets
-rw-r--r--setup.cfg4
-rw-r--r--web/bumble.js1
2 files changed, 4 insertions, 1 deletions
diff --git a/setup.cfg b/setup.cfg
index 191f4e9..1ca73c7 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -36,6 +36,10 @@ install_requires =
bt-test-interfaces >= 0.0.2; platform_system!='Emscripten'
click == 8.1.3; platform_system!='Emscripten'
cryptography == 39; platform_system!='Emscripten'
+ # 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'
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)