Commit Graph

3188 Commits

Author SHA1 Message Date
Myles Scolnick 01dc0d63e8
add marimo to related-projects.md (#4586) 2024-03-02 22:29:55 +09:00
Joel Ostblom 395a18e370
Note that `make` is needed to test packages (#4581) 2024-03-01 15:11:49 -08:00
Gyeongjae Choi f2411848f7
Revert "Make `asyncio.sleep(0)` run faster (#4568)" (#4583) 2024-03-01 12:22:03 +09:00
Joel Ostblom 2731e22844
Add the altair package (#4580)
This adds the altair packages and closes #4579. I wasn't sure what tests would be appropriate, it seems like some package like mpl, pandas, etc tests very specific things whereas others such as shapely, bokeh, statsmodels, etc keep it more minimal. I started minimal for now but happy to add more if there are issues.
2024-02-29 13:23:02 -08:00
Bart Broere 7dd7030724
Bump protobuf version to 4.24.4 (#4553) 2024-02-28 14:22:14 -08:00
Hood Chatham c91684a7e7 Back to development version 2024-02-28 14:11:36 -08:00
Hood Chatham a6dc3e1140 Version 0.26.0a3 take 2 2024-02-28 14:10:23 -08:00
Hood Chatham 31fbdd510e Debug check-release-version CI job 2024-02-28 14:05:50 -08:00
Hood Chatham 6a1b0b09b6 Add CI job to check that release version matches repo file contents 2024-02-28 14:03:57 -08:00
Hood Chatham e6e4750bff Revert "v0.26.0a4"
This reverts commit cb2a4d3cad.
2024-02-28 13:52:31 -08:00
Hood Chatham cb2a4d3cad v0.26.0a4 2024-02-28 13:48:33 -08:00
Hood Chatham 3549bc7bc8 Fix deploy-release job 2024-02-28 13:48:00 -08:00
Hood Chatham 6e162830c0 Revert "v0.26.0a3"
This reverts commit 9ffb47fc44.
2024-02-28 10:46:13 -08:00
Hood Chatham 9ffb47fc44 v0.26.0a3 2024-02-28 09:57:34 -08:00
Hood Chatham da771f2e52
FIX don't let promising call's exception be stolen by interleaved calls (#4564)
Consider the code:
```js
pyodide.runPython(`
    def a():
        raise Exception("hi")
    def b():
        return 7;
`);
const a = pyodide.globals.get("a");
const b = pyodide.globals.get("b");
const p = a.callSyncifying();
assert(b() === 7);
await p;
```

This used to misbehave because because a()'s error status got stolen by b().
This happened because the promising function is a separate task from the js code
in callPyObjectSuspending, so the sequence of events goes:

- enter main task,
    - enter callPyObjectSuspending(a)
        - enter promisingApply(a)
        - sets error flag and returns NULL
    - queue continue callPyObjectSuspending(a) in event loop
        now looks like [main task, continue callPyObjectSuspending(a)]

    - enter b()
        - enter Python
        - returns 7 with error state still set
    - rejects with "SystemError: <function b at 0x1140f20> returned a result with an exception set"
- queue continue main() in event loop
- continue callPyObjectSuspending(a)
    - pythonexc2js called attempting to read error flag set by promisingApply(a), fails with
        PythonError: TypeError: Pyodide internal error: no exception type or value

The solution: at the end of `_pyproxy_apply_promising` we move the error
flag into errStatus argument. In callPyObjectSuspending when we're ready we
move the error back from the errorStatus variable into the error flag before
calling `pythonexc2js()`
2024-02-28 09:55:25 -08:00
Hood Chatham 49c9e7a97c
MAINT Update error handling code to use new Python 3.12 APIs (#4567)
The only behavior change here should be that we are setting `sys.last_exc`
(added in Python3.12). Since we haven't released with Python 3.12 yet, this
doesn't need a changelog.

Python 3.12 added a bunch of modern APIs that handle a single exception object
rather than the (type, val, tb) triples. They also repaired various quirks of
the old error handling APIs. They are much easier to work with. Also, now that
we have `capture_stderr` and `restore_stderr` we can use `PyErr_Print()` to
format the traceback. This allows us to cut out a fair amount of code in
error_handling.c.

This now uses `sys.excepthook` to format exceptions. We set `sys.excepthook` to
`traceback.print_exception` because the default excepthook does not respect the
linecache which we use to implement `pyodide.runPython("...", {file:
"some_file.py"});`
2024-02-28 07:54:28 -08:00
Gyeongjae Choi 5c55d93fc1
Make `asyncio.sleep(0)` run faster (#4568) 2024-02-28 23:14:26 +09:00
Hood Chatham 07a06070e0
Make sysconfigdata relocatable (#4573)
This replaces PYODIDE_ROOT with a variable in all places in the
sysconfigdata. It fixes out of tree numpy build.
2024-02-27 22:12:23 -08:00
Hood Chatham 61fc59497a
Update docs on NativeFS and NodeFS (#4562)
Also I added a useful mountDirectory method to console.html
2024-02-27 07:20:26 -08:00
Hood Chatham f57e9fbee6
MAINT Mark github releases for alpha versions as prereleases (#4571) 2024-02-27 20:55:22 +09:00
Hood Chatham c0e00035d8
JSPI replace syncify() method with run_sync() function (#4548)
This resolves #4398 which happens because not all Futures get the syncify 
method properly attached.
2024-02-26 22:06:59 -08:00
Hood Chatham 0fc565fb55
Add mountNodeFS (#4561)
This is a helper function for mounting native directories in node, analogous to mountNativeFS.
2024-02-26 10:39:49 -08:00
Hood Chatham e643019c18
NFC Remove dist/pyodide.d.ts from all-but-packages (#4563) 2024-02-25 21:54:21 -08:00
Matthias Köppe 6521888a89
New package `ipython` (#4452)
The Sage library uses IPython.lib.pretty
Patches for making at least import IPython work
on Pyodide have been upstreamed in 8.22

The other added packages are dependencies of IPython.
2024-02-25 19:30:16 -08:00
Hood Chatham 482dc5098b
MAINT Fill in a few more typescript types (#4560) 2024-02-24 16:39:36 -08:00
Hood Chatham 9d369c3164
Add error handling to mountNativeFS (#4559)
Most of these cases it would have thrown an error all along and this just adds a clearer error message. The only case where this adds a new error is if the directory is nonempty but is not a file system root. But in that case, it's unexpected that it overwrites the original directory contents. The documentation says:

> If it does exist, it must be empty.

So people might reasonably expect us to throw an error in that case rather than silently overwriting.
2024-02-24 16:39:06 -08:00
Hood Chatham 694efd07cf
Remove pyodide.runPythonSyncifying (#4547)
Since it is now a worse version of pyodide.runPythonAsync since you can stack switch from
there but also you can use top level await.
2024-02-24 13:12:46 -08:00
Bart Broere 2bdf99fea6
Extend protobuf package testing (#4558)
When bumping the protobuf package, it turned out that it wasn't trivial.

I therefore decided to split adding the tests and bumping the version in two PR's. That
way these tests could be merged first, and act as a nice regression test.
2024-02-24 13:12:21 -08:00
Hood Chatham 008a960945
Fix dup in nodefs (#4554)
Backport of emscripten-core/emscripten#21399. Resolves #4541.
2024-02-24 11:34:55 -08:00
Hood Chatham c2076299ef
Make loadPackage sort package lists; put recursiveDependencies on API (#4555) 2024-02-24 22:03:01 +09:00
Gyeongjae Choi 7dd2c64639
Remove cython and tomli from pyodide-build dependency (#4528)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-02-24 11:05:11 +09:00
Hood Chatham 5b1c591c26
Fix leak in pyproxy iteration (#4546) 2024-02-24 10:50:45 +09:00
Agriya Khetarpal dc4cb1b78f
Replace `pkgconfig` with `pkg-config` for Meson configuration file (#4550)
Removes a depreciation warning
2024-02-23 03:33:08 -08:00
Hood Chatham 03496d8d82
MAINT print more details when test fails due to leaked proxy (#4545)
This should make debugging these failures way easier.

Example output:
```
leaked proxies:
tuple (1, 2) Traceback at creation:
    at trace_pyproxy_alloc (/home/rchatham/Documents/programming/pyodide/dist/pyodide.asm.js:3640:23)
    ...
```
2024-02-22 16:54:59 -08:00
Hood Chatham 84977b8f7a
Stack switching: make pystate properly save and restore asyncio state (#4532)
This updates `pystate.c` to save and restore the current event loop task. This allows us to stack switch out of one async task and then block for the completion of another async task.

We also add `callPyObjectMaybeSuspending` which uses `promisingApply` if stack switching is available and otherwise makes a normal call. We add a private keyword argument `_may_syncify` to `create_once_callable` and have the event loop use this so async tasks can stack switch. We also make the promise handles use `callPyObjectMaybeSuspending` so that `promise.then`, `promise.finally_`, etc can use stack switching.
2024-02-22 16:46:43 -08:00
Gyeongjae Choi b961c1f4a3
CI Disable webworker tests in gha (#4538) 2024-02-22 15:31:32 -08:00
Hood Chatham 890cef9321
MAINT Add make target all-but-packages (#4544) 2024-02-22 15:31:06 -08:00
Raymond Berger 6a8041436e
update micropip link [skip ci] (#4542) 2024-02-22 07:42:48 -08:00
Hood Chatham 1bbebf3292 Put the version back to 0.26.0.dev0 2024-02-21 18:26:26 -08:00
Loïc Estève 47bab12c14
Update scikit-learn to 1.4.1.post1 (#4534) 2024-02-19 22:38:00 +09:00
Gyeongjae Choi f9d9fa85fc
Fix WASM_LIBRARY_DIR variable to be compatible for out-of-tree build (#4480) 2024-02-19 22:37:30 +09:00
Hood Chatham 7ca959f0f7
Put pyodide version into xbuildenv name (#4222)
This should reduce the likelihood of accidentally using an xbuildenv for the
wrong Pyodide version.
2024-02-17 12:45:32 -08:00
Loïc Estève 8d15ba9678
Update OpenBLAS to 0.26 (#4526) 2024-02-17 21:34:56 +09:00
Hood Chatham 67906c3c84
MAINT Make search_pyodide_root return None instead of raising (#4520)
Every spot that we call it we have a try block to catch this exception, so
returning None makes the code more succinct
2024-02-16 13:11:32 -08:00
Gyeongjae Choi 909b22497a
Unpin playwright version in GHA (#4525) 2024-02-15 09:15:18 -08:00
Hood Chatham 6537b03076 v0.26.0a2 2024-02-14 16:55:29 -08:00
Hood Chatham 05c7c3ff8c
Distribute the static libraries that we use to link Python (#4516)
This distributes the static libraries produced by Pyodide so that people can easily link
their own interpreter with different build flags.
2024-02-14 16:54:28 -08:00
Hood Chatham 2f11ed71a3
ewah_bool_utils host requires numpy (#4522) 2024-02-14 16:52:00 -08:00
Hood Chatham 2920f8eb05
xfail some core tests in Safari (#4521) 2024-02-14 16:42:49 -08:00
Hood Chatham 88d0592939
xfail failing firefox package tests (#4519)
xfail sisl and bokeh tests on firefox since they time out.
make a separate test that loads sisl and does nothing else to separate the loading time from the testing time.
2024-02-14 16:22:17 -08:00