Commit Graph

948 Commits

Author SHA1 Message Date
Nicholas Bollweg 9c498a8d4f
add msgspec 0.18.4 (#4265)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-10-30 19:55:45 +09:00
Hood Chatham ea6b971ceb
Use JsVal instead of JsRef (nr. 7) (#4254)
Makes `python2js` do what `python2js_val` did and remove `python2js_val`.
Also, when accessing a `JsProxy` attribute invokes a getter and the getter
throws an error, fix it so that the error is propagated instead of being turned
into an `AttributeError`.
2023-10-28 09:50:15 -07:00
Gyeongjae Choi 87a6782bfe
Add more keys in pyodide config CLI command (#4241) 2023-10-28 21:37:55 +09:00
Hood Chatham 53fbd008f6
Switch PyProxy.toString from repr to str (#4247)
Resolves #4040.
2023-10-23 13:38:36 -07:00
Hood Chatham a41e267317
Use JsVal instead of JsRef in more places (nr. 3) (#4236)
This also fixes `JsArray_pop` which leaked memory and returned a singleton array
with the element removed rather than the element itself.
2023-10-22 10:35:44 -07:00
Hood Chatham 6117d7c90d Stack switching (#3210)
Uses the JS Promise integration stack switching API to allow blocking for JavaScript promises and
`PyodideFuture` objects. It's a bit complicated...
This doesn't include support for reentrant switching, currently doing that will corrupt the Python VM.
2023-10-21 09:20:09 -07:00
Szabolcs Dombi 45b3b2ce01
Add zengl 1.16.0 (#4208)
ZenGL provides OpenGL binding for Python.
The same code that runs natively also runs in the browser as-is without modifications.
It does not depend on SDL, emscripten GLES or anything else.
It binds directly to WebGL2.
2023-10-18 13:44:44 -07:00
Hood Chatham 4860848a72
Add package frozenlist (#4231) 2023-10-18 18:14:06 +09:00
Gyeongjae Choi abb8bec1f6
Fix Emscripten.cmake not vendored in pyodide-build wheel (#4223)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-10-15 14:38:41 +09:00
pfebrer 74bd881129
Add `sisl` package (#4210)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-10-13 20:54:27 +02:00
Jo Bovy 9402397fd0
DOCS Add brief section on upgrading packages (#4219) 2023-10-11 20:03:19 -07:00
Hood Chatham cbb008da59
Improve handling of generated typescript files (#4212)
This makes IDEs, documentation generation tools, and linters handle our
generated files better. I set the project root to be `src` instead of `src/js`  
so that it is allowed to import files directly from `src/core`. This way we 
don't have to copy `error_handling.ts` we can just import
`../core/error_handling`.

I made a new folder called `src/js/generated` to place generated files into and
added typescript resolution rules so that when we import a file called
"generated/blah" we first look for `blah` in `src/js/generated` and then fall
back to a file called `blah` in `src/core`.

This also allows us to move around fewer files when building the docs 
and in the makefile.
2023-10-11 08:14:42 -07:00
Hood Chatham dbf4dea326
MAINT Add some more types to various things (#4202) 2023-10-06 19:42:28 -07:00
Max Halford b121e2d088
Add River package (#4197) 2023-10-05 07:02:02 -07:00
Hood Chatham 2988faf8d4
Use upstreamed autosummary and automodule directives (#4196) 2023-10-02 12:00:32 -07:00
Hood Chatham 2bcd48c4c2
Switch to using sphinx-js fork (#4193) 2023-09-30 16:41:02 -07:00
Hood Chatham 53744b4906
DOCS Some minor tuneups (#4189) 2023-09-28 17:09:28 -07:00
Hood Chatham 47024f5dac
Changelog for 0.24.1 (#4171) 2023-09-25 13:37:19 -07:00
Hood Chatham 13d5e0d5c4
FIX Don't crash if checkInterrupt() is called with gil released and no ib (#4164)
`Py_EmscriptenSignalBuffer` could be undefined
2023-09-22 20:46:54 -07:00
Hood Chatham 4774749070
FIX patch a bug in Emscripten that broke matplotlib (#4163) 2023-09-22 19:36:20 +09:00
Luiz Irber 47aea9d9c7
Bump sourmash to 4.8.4 (#4154) 2023-09-22 19:34:15 +09:00
Loïc Estève 7615c0894d
Update scikit-learn to 1.3.1 (#4161) 2023-09-21 13:23:00 +02:00
Loïc Estève 87ab13e9bf
MNT Update scipy to 1.11.2 (#4156) 2023-09-20 11:09:29 +02:00
Gyeongjae Choi e67c182f04
Fix replacing local include paths (#4136)
Co-authored-by: Roman Yurchak <rth.yurchak@gmail.com>
2023-09-20 09:00:04 +02:00
Roman Yurchak ab35dea36e
Don't use importlib.metadata during initialisation (#4147) 2023-09-19 15:39:07 +02:00
Toshiki Teramura d644a405b4
DOC Fix the indent of the document for GH Actions in out-of-tree build page (#4151)
[skip ci]
2023-09-19 10:53:07 +02:00
Hood Chatham f28d8c9efc Revert JSPI Changes
This reverts commits:
9ed5e839ff
8861b317a6
b2c47ae766
ab8dc2eac6
3bcc527c92
2505d4d6a3
2023-09-14 07:26:46 -07:00
Hood Chatham 3bcc527c92 Stack switching (#3210)
Uses the JS Promise integration stack switching API to allow blocking for JavaScript promises and
`PyodideFuture` objects. It's a bit complicated...
This doesn't include support for reentrant switching, currently doing that will corrupt the Python VM.
2023-09-13 16:25:24 -07:00
Hood Chatham 660388431f
0.24.0 (#4137) 2023-09-13 13:10:22 -07:00
Maic Siemering 4cc141084e
DOCS Fix create_proxy example (#4134)
Update outdated import path
2023-09-12 18:33:13 -07:00
Ralf Gommers 8b58984777
Update numpy to 1.25.2 (#4125) 2023-09-09 10:16:08 -07:00
Joe Marshall f438a8daec
skip built in packages when building dependencies (#4058)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Gyeongjae Choi <def6488@gmail.com>
2023-09-06 20:25:54 +09:00
Hannes Krumbiegel c83e290c88
DOCS Add note about forwarding docker port (#4110) 2023-09-05 16:26:14 -07:00
Yossi Shirizli 4099c25793
Add orjson package (#4036) 2023-09-05 06:52:16 -07:00
Gyeongjae Choi b51dee80bb
Rearrange changelog for 0.24.0 release (#4111) 2023-09-04 21:34:57 +09:00
Hannes Krumbiegel 04fa31e92c
Docs: Install pyodide-build from source tree (#4113) 2023-09-02 13:04:33 -07:00
Angus Hollands 571e843e9a
feat: add awkward-cpp v22 (#4101) 2023-08-30 16:28:59 +02:00
Hood Chatham a8f2409426
ENH Add `loadPyodide` `packages` option for loading packages during bootstrap (#4100)
For improved loading performance.
2023-08-29 13:43:07 +02:00
Hood Chatham df527fdad5
Emscripten 3.1.45 (#4094) 2023-08-29 13:37:31 +02:00
Hood Chatham 09c7251d56
DOCS minor changes to quickstart (#4098)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-08-29 17:53:44 +09:00
Ian Thomas f769f83023
Add contourpy 1.0.7 package (#4102)
This PR adds the ContourPy package, which is a C++ extension that is a dependency
of Matplotlib >= 3.6.0 and Bokeh >= 3.0.0. Note that this is the previous version (1.0.7)
of ContourPy, not the latest one (1.1.0) that uses Meson as I am still trying to get that
to build with the correct compiler flags.
2023-08-29 09:58:20 +02:00
Hood Chatham 5960544ef2
PERF Avoid instance checks in pyproxy_getflags when possible (#4096)
Profiling shows that `PyObject_IsInstance` is pretty expensive. This
skips it when conditions we've already measured imply that they will
return false anyways.

This gives a 33% performance improvement on the following:
```js
pyodide.runPython(`
from pyodide.code import run_js
from timeit import timeit
f = run_js("() => {}")

d = {}

n = 200000
timeit("f(d)", number=n, globals={"f": f, "d": d}) / n * 1e6
`);
```
2023-08-28 16:12:45 +02:00
Hood Chatham 303e02e5a7
ENH Add `response.text` to `pyodide.http.FetchResponse` (#4052)
We've received feedback from users that use other requests APIs that they expect
the method to be called `response.text` instead of `response.string`. Indeed both
the Fetch response API and the Python requests library use this convention:

https://developer.mozilla.org/en-US/docs/Web/API/Response/text https://requests.readthedocs.io/en/latest/api/#requests.Response.text

This adds `response.text` to `FetchResponse`. It is a synonym for `response.string`.
This also marks `response.string` as deprecated but does not schedule it for removal.
2023-08-28 13:40:56 +02:00
Hood Chatham 311fa904d4
ENH add filename argument to runPython and use linecache for better tracebacks (#3993) 2023-08-28 13:18:50 +02:00
Hood Chatham 4d99d07366
Emscripten 3.1.44 (#4073) 2023-08-26 22:46:42 +02:00
nascheinkman 7b0af2d4cd
Add CoolProp v6.4.3 to packages (#4028)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-08-23 20:19:14 +09:00
Luiz Irber 070bb2e9c0
Bump sourmash to 4.8.3 (#4075) 2023-08-23 20:18:13 +09:00
Hannes Krumbiegel ce36a6d521
Add comment that WSL 2 is needed on Windows (#4079) 2023-08-21 21:13:01 +09:00
Neil Stoker 9369ce0019
Docs: update list of removed stdlib pkgs (#4078) 2023-08-21 08:43:52 +02:00
Hood Chatham e19621d483
ENH Rework streams handling (#4035)
This fixes a number problems with the old stream handling:

1. Not possible to set a custom errno (necessary for proper interrupt
   handling and possibly for other things)

2. Inefficient: in a lot of cases we have data in one buffer and we need
   it placed into a different buffer, but we have to implement a function
   that gets one byte out of the source buffer and then call it repeatedly
   to move one byte at a time to the target buffer.

3. Ease of implementation: in many cases we already have perfectly good
   buffer manipulation APIs, so if we have direct access to the true source
   or target buffer we can just use these. See: the node IO code, which got
   much simpler.

This is backwards compatible, so you can still use the old input mechanism
or use buffered or raw output. But it adds a new method of directly implementing
read/write. For simplicity, we insure that the source/destination buffers are
always `Uint8Array` views that point to exactly the region that is meant to be
read/written.

The old mechanisms are faster than before and can correctly support keyboard
interrupts. Other than that I think the original behavior is unchanged. I added a
lot more test coverage to ensure backwards compatibility since there was pretty
anemic coverage before.

I think the read/write APIs are mostly pretty simple to use, with the exception
that someone might forget to return the number of bytes read. JavaScript's ordinary
behavior coerces the `undefined` to a 0, which leads to an infinite loop where the
filesystem repeatedly asks to read/write the same data since it sees no progress.
I added a check that writes an error message to the console and sets EIO when undefined
is returned so the infinite loop is prevented and the problem is explained.
2023-08-21 08:41:44 +02:00