Commit Graph

3292 Commits

Author SHA1 Message Date
Hood Chatham c53ff47046
BLD Clean up unused Makefile sed (#4785)
This stuff is no longer needed since the update to Emscripten 3.1.58.
2024-05-23 17:42:31 -04:00
Hood Chatham c7a411137a
Remove DEMANGLE_SUPPORT (#4786)
This is deprecated and I think we don't need it anymore.
2024-05-23 17:42:03 -04:00
Philipp Schiele a6d2fb0356
Updates CVXPY to 1.5.1 (#4781) 2024-05-22 11:07:54 -04:00
Gyeongjae Choi c3d1eff411
TST Improve xbuildenv and emscripten mocks (#4741)
The goal of this PR is to reduce the dependency on pyodide for testing pyodide-build. The main changes are:

1. Add a new fixture: `mock_emscripten` for mocking emscripten compiler toolchain. This fixture will create a dummy emcc (+ other toolchains) to the PATH. When running tests, all emcc calls will be intercepted by this command.

2. Improve `xbuildenv` fixture. Previously, this fixture actually created an xbuildenv from the Pyodide artifacts. So, we had to have Pyodide already built before running the tests. In this PR, this fixture now uses a pre-built minimum xbuildenv.

As a result, now all tests in `pyodide-build` run without building Pyodide. The only exception is `test_xbuildenv_create` which test `pyodide xbuildenv create` command. In a follow-up, I am planning to migrate the `provide venv` tests, which are in `test_cmdline_runner.py.`
2024-05-21 22:35:34 -04:00
Hood Chatham e2893d53e3 Version 0.26.0a6 2024-05-21 18:17:53 -04:00
Hood Chatham f05a86c22e
Fix out of tree build after #4777 (#4780)
I updated the platform when we build with build-recipes but not with pyodide
build. This also updates the platform tag for wheels produced with pyodide
build.
2024-05-21 18:16:34 -04:00
Hood Chatham f352fd34fb
Fix Safari CI a bit (#4778)
Safari doesn't have URL.canParse
2024-05-21 14:43:12 -04:00
Hood Chatham 9389a042ed Version 0.26.0a5 2024-05-21 12:35:10 -04:00
Hood Chatham abac299a00 Update changelog for #4777 2024-05-21 12:34:04 -04:00
Hood Chatham c76feab80f
Change wheel tag from emscripten to pyodide (#4777)
More specifically we went from emscripten_3_1_58_wasm32 to pyodide_2024_0_wasm32.
2024-05-21 12:30:01 -04:00
Yuichiro Tachibana (Tsuchiya) 0c2dea7882
DOCS Add stlite and Gradio-Lite to the related-projects page (#4776) 2024-05-21 06:18:47 -04:00
Hood Chatham b6abe47a86
Rename asJsonAdaptor to asJsJson (#4771) 2024-05-19 07:30:08 -04:00
Hood Chatham 9fe6e62003
Rearrange changelog for 0.26.0 (#4755) 2024-05-19 05:43:52 -04:00
Alexey Ignatiev 1c3addfdb4
Version bump for python-sat (#4759)
This PR bumps the version of python-sat to 1.8.dev13, which fixes a few minor
issues in MUS extraction tool "MUSx".
2024-05-19 05:42:58 -04:00
Henry Schreiner 1b4660d8bd
chore: use hatchling instead of setuptools (#4770)
This swaps out the build backend of pyodide-build for hatchling, which is
simpler and faster.

The difference in the SDists: This removes the zip directories entries,
setup.cfg, and .egg-info directory and contents. It includes the .gitignore,
since hatchling uses that to decide what to include by default.

The difference in the wheel built from the SDist: The useless top_level.txt is
gone and the license is in the licenses directory.
2024-05-19 05:38:17 -04:00
Henry Schreiner 354e7a1864
chore: bump awkward-cpp (#4766)
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
2024-05-18 22:04:05 -04:00
Henry Schreiner 63bc7d4f1e
chore: restore pipx run support without —spec (#4768)
This should restore support for `pipx run pyodide-build` instead of 
`pipx run --spec pyodide-build pyodide` by teaching pipx about the primary entry
point in the package.

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
2024-05-18 08:00:52 -04:00
Hood Chatham 68c1fe5d2f
FIX Remove assignment of PyProxyFunction to globalThis (#4758)
Seems to be something that I added for debugging and I left in by mistake
2024-05-17 14:53:11 -04:00
chrysn b177dba277
packages: Add lakers-python (#4763)
This adds Lakers (`lakers-python` on PyPI), the Python wrappers for the Rust
implementation of EDHOC (RFC9528). EDHOC is a compact key exchange protocol,
primarily designed for embedded systems.

As a compiled package it can not use the pure Python wheels published through
crates.io. It is useful in pyodide because aiocoap has [good support for pyodide
and Jupyter](https://aiocoap.readthedocs.io/en/latest/pyodide.html) for
end-to-end encryption between a browser console (or application) and an embedded
device (connected through untrusted proxies on the Internet or through local
Bluetooth connections). I expect to add EDHOC support to aiocoap through lakers.
2024-05-16 10:28:58 -04:00
goulashsoup 7e1b136e28
Add required --root` to `./run_docker` build from source documentation (#4754) 2024-05-10 18:46:42 -04:00
Hood Chatham a8021791a5
Snapshots: allow snapshotting some user code (#4720)
This adds some basic ability to snapshot after executing user code. It is pretty
brittle right now:
1. It will crash if the user loads any binary extensions before taking the
snapshot
2. It doesn't track changes to the file system

Snapshots will probably have to be experimental for quite a while.

1. I think I have a pretty good solution for this, which I will work on in a
followup.

2. One possibility here is we could serialize the entire filesystem state into
the memory snapshot. This would be hard and make the snapshot big, but we
wouldn't have to load python_stdlib.zip when restoring from a snapshot so it
probably wouldn't increase the total download size by much...
2024-05-10 18:15:17 -04:00
Gyeongjae Choi afe7215c06
Bump pydantic version used in pyodide-build to v2 (#4676)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-05-10 21:44:19 +09:00
Hood Chatham 902453a231
Add JsProxy bindings system (#4699)
We've gotten a lot of complaints about how hard it is to call certain JS
functions, but it's hard to do much to improve the situation without knowing
anything about the specific function being called.

However, if we know about the API, we can choose how to convert to/from JS as
appropriate and make things a lot easier. This adds a method to JsProxy called
`bind_sig` which adjusts how __getattr__ and __call__ work on the proxy so we
can choose our converters. I added a class called JsSignature which
guides what we do when we call the function. I completely rewrote
JsProxy_Vectorcall to use this. I added handling for Promise results so we can
automatically bind a signature to the result of the Promise.

There's a lot leftover to do:
* Generator and AsyncGenerator types
* Alternatives A | B (try A converter and if it raises a TypeError fall back to B)
* TypedDict converters
* Make calling certain objects call `Reflect.construct`
* Cleaner __getattr__ handling, __setattr__ handling
* A way to raise AttributeError if the attribute is missing from the signature
  even if it's present in the JS object (important for backwards compatibility)
* Signatures for JS stdlib functions

My idea is that the signatures should simultaneously function as mypy typehints
as much as this is practical.
2024-05-09 16:21:14 -04:00
Hood Chatham 7c6f671af6
DOCS Fix sphinx-click "Unexpected section title or transition" warnings (#4750)
I made two PRs to sphinx-click and this uses them:
click-contrib/sphinx-click#137
click-contrib/sphinx-click#138
2024-05-09 16:19:15 -04:00
Hood Chatham fd31fc135e
Update sphinx-js again and more edits (#4744)
This pulls in the newest commits of sphinx-js that can render type aliases and
interfaces into the docs. I used it to add documentation for `PackageType` and
`PackageData`. It also adds type params in the signature line of js functions,
which I'm actually not sure is that great since the signature line otherwise has
no types.
2024-05-09 10:19:37 -04:00
Philipp Schiele dd445ec2b6
Uses CVXPY 1.5.0 release (#4746) 2024-05-09 21:01:26 +09:00
Hood Chatham 4773c6cf73
Update docs to use latest sphinx-js version (#4742)
This pulls in the tip of the master branch of sphinx-js and shortens the
jsdoc.py patches by about 60 lines.

I also fixed some broken links and various typedoc and sphinx warnings.
I turned on nitpicky mode and silenced intentionally broken links so in the
future we can catch broken xrefs better. These warnings also help turn up
cases where private fields are accidentally included into the docs.
2024-05-07 12:40:33 +02:00
Hood Chatham 9d2451d1fb
Emscripten 3.1.58 (#4715) 2024-05-07 09:59:57 +02:00
Hood Chatham b19d33eaa3
NFC: Clean up emscripten settings a bit (#4726)
I renamed module.ts to emscriptenSettings.ts which is more descriptive. Rather
than setting a bunch of the settings fields from pyodide.ts, set them in
createSettings. I also marked all these fields as readonly so typescript can
help us ensure that they are set up correctly in createSettings and not edited
from pyodide.ts.

I changed most of the functions in `emscriptenSettings.ts` to return a
`PreRunFunc` rather than taking the settings as an argument and mutating it.

I also removed the `moduleLoaded` `postRun` hook, I believe that it hasn't
been needed for a long time.
2024-05-06 10:52:20 +02:00
Yuichiro Tachibana (Tsuchiya) c7ab4193c2
Fix loadPackage() to call mkdir only when needed (#4738)
Resolves #4736
2024-05-06 10:50:26 +02:00
Gyeongjae Choi cc6b585d09
Add missing library dependencies to packages (#4735)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-05-03 20:22:40 +09:00
Gyeongjae Choi c4a6964429
Use Pyodide version instead of pyodide-build version when creating lockfile (#4732)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-05-02 20:32:10 +09:00
Gyeongjae Choi a040b78a97
Update `pyodide create-zipfile` command to accept list of modules to exclude (#4723) 2024-05-01 19:20:07 +09:00
Gyeongjae Choi e3cf592ae4
Bump pytest-pyodide version to 0.57.0 (#4727) 2024-05-01 19:19:45 +09:00
Hood Chatham baac136b64
Run `make -C packages update-all` (#4712)
Packages that I reverted:

bitstring, fiona, gdal, matplotlib, numcodecs, packaging, pandas, Pillow,
pillow_heif, protobuf, pyinstrument, rebound, reboundx, scipy, shapely, spareqr,
river, xgboost, yt, zarr
2024-04-30 15:51:48 +02:00
Gyeongjae Choi d5fdf22aff
FIX Use response file for EXPORTED_FUNCTIONS (#4717)
Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
2024-04-30 18:36:39 +09:00
Gyeongjae Choi 0e23252426
Fix url filename parsing again (#4722) 2024-04-28 19:48:25 +09:00
Hood Chatham 334628426f
Distinguish between emscripten settings and instantiated emscripten module (#4718)
In Emscripten v3.1.58, createPyodideModule returns a distinct object from its argument
so if we confuse EmscriptenSettings with the instantiated module, we'll get problems.
This fixes these problems.

I also added some more type declarations.

Split from #4715.
2024-04-27 14:39:36 +02:00
Gyeongjae Choi ed3b787b60
BLD Extract out package build configs from Makefile.envs (#4708) 2024-04-27 11:30:06 +09:00
Gyeongjae Choi 55339e00e4
Re-enable and update XGBoost (#4716)
Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
2024-04-27 09:18:10 +09:00
Hood Chatham 4633a958da
Remove possible query string from tarballname (#4721)
For CoolProp, we are getting `tarballname` as `'CoolProp_sources.zip?viasf=1'` which then
crashes when we give it to `shutil.unpack_archive` with `Unknown archive format`.
2024-04-26 21:32:06 +02:00
Hood Chatham d32e376013
Memory snapshots (#4652)
Add basic support for memory snapshots
2024-04-23 15:01:33 +02:00
Hood Chatham b45c2a5273
More rearrangement to reduce diff in #4699 (#4711)
More nonfunctional changes to reduce diff in #4699. Reduces the diff there by about 400 lines.
2024-04-23 12:00:07 +02:00
Hood Chatham a36ac37e40
Move JsMethod call implementation into separate file (#4710)
Nonfunctional refactor to reduce diff in #4699
2024-04-22 14:19:30 +02:00
Hood Chatham 33a24c287f
Rename callSyncifying to callPromising, add callWithOptions (#4608)
Since we renamed `syncify` the method name `callSyncifying` doesn't make much
sense anymore. It is implemented in terms of a so-called `promising` wasm call,
so `callPromising` lines up with that. Not a perfect name, but it is rarely used so it
will do until we come up with something better.

Added a `callWithOptions` function. We now have three boolean parameters for
a Js-to-Python call:
1. kwargs
2. promising
3. relaxed

So we'd need 8 functions to cover all combinations of these. Currently we only
have 6 of these. Rather than adding the two remaining combinations which will
have annoying names, I added `callWithOptions` which takes an options argument as
the first argument. Despite the fact that options usually go as the last
argument, I think it makes sense to use the first argument for this so that all
remaining args are passed on to Python.
2024-04-22 14:17:51 +02:00
dependabot[bot] b36b13ab58
github-actions update actions/checkout and actions/setup-python (#4709)
Bumps the github-actions group with 2 updates: actions/checkout and actions/setup-python.
2024-04-22 12:37:36 +02:00
Henry Schreiner b886ed2065
fix: support cmake command mode (#4705) 2024-04-22 12:12:44 +02:00
Gyeongjae Choi 6fb3d7340c
BLD Add a file holding cross build environment metadata (#4695) 2024-04-20 22:52:37 +09:00
Alexey Ignatiev f7d844acc9
Bumped python-sat from 1.8.dev10 to 1.8.dev12 (#4702) 2024-04-20 22:48:26 +09:00
Gyeongjae Choi 975565bc3f
BLD Prevent redundant xbuildenv installation if there is already a version in use (#4694) 2024-04-18 21:09:00 +09:00