Commit Graph

1266 Commits

Author SHA1 Message Date
Hood Chatham 7268e45c0f
Simplify hiwire constants (#1213)
Previously they were defined as macros and getters were defined for use in javascript, since javascript cannot access macros. Now both are replaced by global constants.
2021-02-08 13:51:12 +08:00
Roman Yurchak 5d50a5f96a
Revert removal of xfailed scipy dependent tests (#1205) 2021-02-07 08:37:22 +01:00
Hood Chatham c4627897fa
TST: Fix test_monkeypatch_eval_code (#1206) 2021-02-06 21:20:34 +01:00
Hood Chatham 19ebad28dc
DOC Use sphinx-js for pyodide_js documentation (#1197) 2021-02-06 21:17:57 +01:00
rdb 5d392a6699
DOC Fix broken links in README.md (#1199) 2021-02-06 11:48:13 +01:00
joemarshall 1bd8380c01
Emscripten 2.0.12 Upstream backend (#1102)
Co-authored-by: Dexter Chua <dalcde@users.noreply.github.com>
Co-authored-by: Roman Yurchak <rth.yurchak@gmail.com>
2021-02-06 08:58:12 +01:00
Roman Yurchak e5672449f9
F2C, CLAPACK, scipy and numpy fixes for the upstream backend (#1193)
Co-authored-by: Joe Marshall <joe.marshall@nottingham.ac.uk>
2021-02-05 10:54:12 +01:00
Hood Chatham a4fad9b500
Add simple web loop (#1158) 2021-02-05 09:20:15 +01:00
Hood Chatham d27ee60077
Remove empty jsimport.* files (#1196) 2021-02-05 11:34:59 +08:00
Hood Chatham 503741ea48
PyProxy methods for iterators / iterables / generators (#1180) 2021-02-04 21:16:27 +01:00
Roman Yurchak 4972343414
pywasmcross improvements to work with the upstream backend (#1184)
Co-authored-by: Joe Marshall <joe.marshall@nottingham.ac.uk>
2021-02-04 12:34:40 +01:00
Hood Chatham 48db27d6d2
Change isPromise to accept nonstandard javascript awaitables (#1189) 2021-02-04 09:30:40 +01:00
Hood Chatham fe0329bae8
MAINT Rewrite JsProxy_IterNext (#1187) 2021-02-04 09:24:48 +01:00
Hood Chatham 9cd51da504
Allow awaiting the same proxied promise multiple times (#1163) 2021-02-04 09:21:44 +01:00
casatir d9fffe15b6
Fix REPL completion (#1191) 2021-02-04 08:38:39 +01:00
Hood Chatham f60e43efda
TST py->js->py conversion for list and dict (#1188) 2021-02-03 23:49:01 +01:00
Hood Chatham b3a965a1f6
Don't automatically copy python objects into javascript (#1167)
* Don't automatically copy python objects into javascript, add new PyProxy.shallowCopyToJavascript and deepCopyToJavascript apis

* Lint

* Adjust conftest to automatically deep_copy results of run / run_async

* Update conftest again

* Fix deep/shallowCopyToJavascript

* Fix shallowCopyToJavascript and deepCopyToJavascript to return js object not hiwire id

* Fix the remaining tests (hopefully)

* Lint

* Fix more tests

* Fix some numpy tests

* Lint

* Fix more tests

* Lint

* Temporarily dummy out setLineDash since it breaks test

* Fix test_console

* Update changelog
2021-02-02 19:45:56 +01:00
Roman Yurchak 28f168cf2e
Fix uninitialized variables in PyProxy (#1183)
Co-authored-by: Joe Marshall <joe.marshall@nottingham.ac.uk>
2021-02-02 09:53:28 +01:00
Dexter Chua 68cdeb519d
Add missing -fPIC in CLAPACK (#1185)
Co-authored-by: Joe Marshall <joe.marshall@nottingham.ac.uk>
2021-02-02 01:26:16 +01:00
Hood Chatham f9fb31d102
Add setInterruptBuffer to public API, update changelog and docs (#1173) 2021-01-31 15:59:13 +01:00
Dexter Chua 4de39e3617
Run benchmarks in alphabetical order (#1178)
Co-authored-by: Roman Yurchak <rth.yurchak@gmail.com>
2021-01-30 13:58:34 +01:00
Hood Chatham d548644ad0
Fix merge error between PR #1169 and #1176 (#1177) 2021-01-30 10:16:09 +01:00
Hood Chatham 5631fcd1d6
Fix compile error from methnoargs-signatures branch (#1176) 2021-01-30 00:17:56 +01:00
Hood Chatham c12e245191
Fix METH_NOARGS function signatures (#1169) 2021-01-29 21:24:14 +01:00
Hood Chatham 7d68edc447
DOC Fix broken link in readme (#1174) 2021-01-25 13:19:17 +01:00
Jan Max Meyer fd351bc4fc
MAINT Minor Makefile improvements (#1161) 2021-01-23 00:18:30 +01:00
Jan Max Meyer 81810a4c4b
Revert "Don't automatically copy python objects into javascript (#1152)" (#1165)
This reverts commit 6a44233562.
2021-01-22 18:22:31 +01:00
Hood Chatham 6a44233562
Don't automatically copy python objects into javascript (#1152)
* Don't automatically copy python objects into javascript, add new PyProxy.shallowCopyToJavascript and deepCopyToJavascript apis

* Lint

* Adjust conftest to automatically deep_copy results of run / run_async

* Update conftest again

* Fix deep/shallowCopyToJavascript

* Fix shallowCopyToJavascript and deepCopyToJavascript to return js object not hiwire id

* Fix the remaining tests (hopefully)

* Lint

* Fix more tests

* Fix some numpy tests

* Lint

* Fix more tests

* Lint

* Temporarily dummy out setLineDash since it breaks test
2021-01-22 12:28:22 +01:00
casatir 1fa4b07809
Use rlcompleter instead of Jedi for completion in console (#1160) 2021-01-21 22:27:35 +01:00
Hood Chatham fc83e28905
Make JsBuffer into a subclass of JsProxy (#1153)
* Make JsBuffer into a separate subclass of JsProxy

* Make Buffer objects with type JsBufferType not JsMethodType

* Lint
2021-01-21 18:53:43 +01:00
Roman Yurchak f9f01be97d
MAINT/CI Fix documentation CI (#1157) 2021-01-20 23:34:38 +01:00
Hood Chatham f8d363822c
Patch ceval to add callback to use for KeyboardInterrupt handling (#1148)
* Patch ceval to add interrupt handler callback

* Don't use SharedArrayBuffer in test, Firefox doesn't expose it

* Fix test

* Retest

Co-authored-by: Jan Max Meyer <jmm@phorward.de>
2021-01-20 23:27:28 +01:00
Hood Chatham a8c38fe289
Handle fatal runtime errors (#1151)
* Handle fatal runtime errors

* Wrote "fatal_error" code

* Fix _pyproxy_set

* Fix ownkeys

* Fix PyProxy.toString
2021-01-20 23:18:19 +01:00
casatir 829e2d4d1e
Completion support in InteractiveConsole (#1155) 2021-01-20 08:10:59 +01:00
casatir 3128b1ad1e
MAINT Remove rendered.html (#1156) 2021-01-19 21:19:25 +01:00
casatir e8a8a107ff
REPL Correct repr in InteractiveConsole (#1141) 2021-01-19 07:30:07 +01:00
Hood Chatham 3e2e4960ad
DOCS: document core (#1048) 2021-01-19 06:28:59 +01:00
Hood Chatham dbc60a8abf
DOCS: Move docs into three subfolders based on top level sections (#1149) 2021-01-18 20:56:47 +01:00
Hood Chatham d98c12141a
TST: Test eval_code_async (#1109)
Co-authored-by: Jan Max Meyer <jmm@phorward.de>
2021-01-18 18:10:40 +01:00
Hood Chatham 92bdf28e42
Add more _Py_NO_RETURN markers (#1150) 2021-01-18 18:07:21 +01:00
Hood Chatham b753272c2f
BACKEND: Python2js converter with depth param (#1128)
* Added python2js_with_depth which only does lossy conversions down to a certain depth

* Added tests

* Fix reference error in test

* Fix typo in tests

* Use more sensible name _fresh_result for macro hygene as recommended by phorward

* Lint
2021-01-17 22:15:28 +01:00
Hood Chatham cb3590b6c9
MAINT: Minor cleanup of pyproxy (#1136)
* Minor cleanup of pyproxy

* Fix `isPyProxy` to handle undefined or null argument correctly

* Remove _pyproxy_enumerate

* Remove stray semicolon

* Forgot to _getPtr in apply

* Forgot to "return Reflect.get"

* Cleanup a bit

* Update test to reflect changes to behavior of pyproxy_dir

* Try again to get test dir right

Co-authored-by: Jan Max Meyer <jmm@phorward.de>
2021-01-17 20:11:48 +01:00
Dexter Chua 83a1d7b328
TST: Combine run_js_async and run_js (#1143) 2021-01-17 10:12:20 +01:00
Hood Chatham 7374be5c29
Flexible jsimport (#1146)
This allows users to bind arbitrary JS objects as python modules. This is used to implement the `js` module. Fixes #960
2021-01-17 12:33:50 +08:00
Hood Chatham a961851e53
Mark pythonexc2js as noreturn (#1147) 2021-01-17 08:47:59 +08:00
Dexter Chua 293fefa7df
Don't print duplicate error message in chrome (#1144)
In chrome, the error message is contained in the stack. Avoid printing
it twice.
2021-01-16 13:50:40 +01:00
Hood Chatham 3fef124b87
Move call and new to JsMethod (#1138)
The goal of this PR is to ensure that JsProxy is no longer callable, now only JsMethod will be callable. Many bugs were caused by differences in behavior between the JsProxy_Call and JsBoundMethod_Call. If we build a proxy of a callable javascript object, we will use the subclass JsMethod. This way, there is only one Call method and no bugs caused by divergent behaviors.
2021-01-16 14:36:23 +08:00
Hood Chatham c533b071ba
BUGFIX: Bind functions to window on `from js import func` (#1126)
Fixes #461
2021-01-16 13:34:05 +08:00
Hood Chatham 603d223b7b
Fine tuning of error_handling debug tools (#1142) 2021-01-16 10:40:01 +08:00
Dexter Chua 4c5c30779f
Touch npm binaries after installation (#1140)
`npm i` does not update timestamps if it ends up not installing or updating the packages. Before this commit, if emsdk is recompiled after installing these packages, then `npm i` will be triggered every build, because lessc and uglifyjs are older than emsdk.
2021-01-16 09:00:53 +08:00