From ddbdb92470b2b7f64e27cac61ae98614e85b3676 Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Thu, 22 Jun 2023 22:19:51 +0000 Subject: [PATCH 1/3] chore: `npm i` should be run in `python/pythonmonkey` directory --- build_script.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/build_script.sh b/build_script.sh index 22f2bfe4..0947ee9a 100755 --- a/build_script.sh +++ b/build_script.sh @@ -11,5 +11,6 @@ cd build cmake .. cmake --build . -j$CPUS +cd ../python/pythonmonkey # npm is used to load JS components, see package.json npm i From bcd6f6785a05d0b87ab5881dc4b662e12ff67b61 Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Thu, 22 Jun 2023 22:22:02 +0000 Subject: [PATCH 2/3] test(promise): fix regex doesn't match when having `ctx-module` The input string contains the newline character `\n` , but the regex doesn't match across multiple lines --- tests/python/test_pythonmonkey_eval.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/python/test_pythonmonkey_eval.py b/tests/python/test_pythonmonkey_eval.py index eae889c5..ef068318 100644 --- a/tests/python/test_pythonmonkey_eval.py +++ b/tests/python/test_pythonmonkey_eval.py @@ -842,7 +842,7 @@ async def coro_fn(x): # JS Promise to Python awaitable coercion assert 100 == await pm.eval("new Promise((r)=>{ r(100) })") assert 10010 == await pm.eval("Promise.resolve(10010)") - with pytest.raises(pm.SpiderMonkeyError, match="TypeError: .+ is not a constructor"): + with pytest.raises(pm.SpiderMonkeyError, match="^TypeError: (.|\\n)+ is not a constructor$"): await pm.eval("Promise.resolve")(10086) assert 10086 == await pm.eval("Promise.resolve.bind(Promise)")(10086) From 3423f195d8858811623c56073a78b17e840f4620 Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Thu, 22 Jun 2023 22:33:44 +0000 Subject: [PATCH 3/3] chore: must explicitly include `node_modules` into the wheel package MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If a VCS is being used for a package, Poetry exclude field will be seeded with the VCS’ ignore settings (.gitignore for git for example). --- pyproject.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 87dc9e88..55f95d68 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,6 +11,8 @@ include = [ "python/pythonmonkey/pythonmonkey.so", "python/pythonmonkey/libmozjs*", + "python/pythonmonkey/node_modules/**/*", + # include all files for source distribution { path = "src", format = "sdist" }, { path = "include", format = "sdist" },