Commit Graph

439 Commits

Author SHA1 Message Date
Boris Feld 8ffd03f48e
Update changelog.md (#2352)
The changelog for release 0.19.1 rendering was broken 
as `Type Translations` title level was too high.
2022-04-04 11:47:06 -07:00
Tom White a69fb1bbb7
Enable ANSI escape codes in console (#2345)
Currently, ANSI escape codes are not supported in the console.
This is fixed by adding an extra javascript file that jQuery Terminal needs to render the codes.
2022-04-03 14:31:41 -07:00
Hood Chatham b12399c9ae
Add lazy-object-proxy (#2320)
Co-authored-by: Roman Yurchak <rth.yurchak@gmail.com>
2022-04-02 14:07:50 +02:00
Hood Chatham c27d2e712b
Switch extractDir to camelCase (#2333)
The other key word arguments in our JavaScript apis have camelCase names. It's good to be consistent.
2022-03-31 18:26:29 -07:00
Hood Chatham c982e6b42d
ENH Automatically schedule coroutines (#2319)
Without this PR,
```js
let f = pyodide.globals.get("some_async_function");
setTimeout(f, 100);
```
doesn't work because `setTimeout` calls `f` which returns a coroutine
which is left unscheduled and so the actual work in `f` is never executed.
This is surprising to people, see for instance
https://github.com/pyodide/pyodide/discussions/2229.
This changes the behavior to automatically schedule all coroutines created
from async functions called from Javascript so that async functions can be
used as Javascript event handlers.
2022-03-28 20:06:46 -07:00
Hood Chatham 2838dfa527
Change extract_dir argument of unpackArchive to be a keyword argument (#2306)
Old usage is still accepted but causes a deprecation warning, saying
we will remove it in v0.21. Similar to #2300. I am planning to add
an option to do wasm compilation in a subsequent PR.

I also did some cleanup from #2300 and added tests for the deprecation
warnings.
2022-03-27 22:40:31 -07:00
Will Lachance 075714f30f
Update documentation for passing in global namespace (#2324)
Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
2022-03-27 13:23:23 -07:00
Gyeongjae Choi 7895bd57b9
DOC Add deprecation timeline (#2314)
* Add deprecation timeline [skip ci]

* Add pyodide-interrupts removal
2022-03-27 17:04:08 +09:00
Hood Chatham d091e64c10
Handle signals other than SIGINT with interrupt_buffer (#2301) 2022-03-25 08:48:08 -07:00
Karthikeyan Singaravelan 5a302466d8
Fix broken link (#2316) 2022-03-25 15:07:31 +09:00
Hood Chatham 818dfe4a5b
Remove pyodide-interrupts (#2309) 2022-03-24 12:58:04 -07:00
Hood Chatham 04b75b04e5 Add changelog entry for Emscripten update (#2295) 2022-03-24 09:21:05 -07:00
Hood Chatham e865b77040
Fix scipy linking errors (#2289)
With newer versions of emscripten, linker errors surface eariler.
This makes it easier to find function pointer cast errors without
having to execute the bad code path -- the errors happen when the
wasm modules are linked (at load time in the browser)

Anyways, this fixes more linker errors. Mostly the problems have
to do with LAPACK functions that take string arguments. Most
LAPACK functions that take string arguments use them as enums and
only care about the first character of the string. Because of the
way that f2c works, we need to replace these strings with the ascii
code of the first character so we should replace:

sTRSV( 'UPPER', 'NOTRANS', 'NONUNIT', J, H, LDH, Y, 1 )
==>
CALL sTRSV( 85, 78, 78, J, H, LDH, Y, 1 )

where 85 and 78 are the ascii codes of U and N. Various character
variables are subbed into being integer variables. The two
functions `ilaenv` and `xerbla` expect actual C strings as an
argument, but it is very annoying to produce C strings so instead
I added wrapper functions ilaenvf2c and xerblaf2c to clapack and
instead of calling ilaenv and xerbla we call the f2c versions.
2022-03-23 23:17:29 -07:00
Hood Chatham 9b3d72b0c9
Change runPython and runPythonAsync 'globals' to be passed as a named argument (#2300)
This is for future-proofing in case we decide to add more options at
some point. Old usage is still accepted but causes a deprecation warning, 
saying we will remove in v0.21.
2022-03-23 11:01:23 -07:00
Frank 0a2b307cc2
PKG Add python-solvespace (#2287)
python-solvespace is a python library from the geometric constraints
solver of SolveSpace, open source CAD software.
2022-03-22 21:52:43 -07:00
Hood Chatham bfcc58b6e2
Update new package docs and add more detailed meta.yaml validation (#2297) 2022-03-22 12:03:45 -07:00
Hood Chatham 880fc39835
Add handling and tests for weird Javascript errors (#2294)
On rare occasions, a Javascript object that isn't an error gets thrown.
This PR ensures that we are handling this situation without anything going
too far astray.

This is a followup to #2236.
2022-03-22 00:31:08 -07:00
Hood Chatham 7f908beb4c
ENH Calculate indexURL from error stack trace (#2292)
If no indexURL is provided, we throw and catch an error and
then use ErrorStackParser to calculate where pyodide.js has
been loaded from. Resolves #2290.

Question: But getting the URL from error stack trace is well... really
hacky. Can't we use
[`document.currentScript`](https://developer.mozilla.org/en-US/docs/Web/API/Document/currentScript)
or
[`import.meta.url`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import.meta)
instead?
Answer: `document.currentScript` works for the browser main thread.
`import.meta` works for es6 modules. In a classic webworker, I think there
is no approach that works. Also we would need some third approach for node
when loading a commonjs module using `require`. On the other hand, this
stack trace approach works for every case without any feature detection
code.
2022-03-20 22:44:54 -07:00
Hood Chatham a356fc4563
Fix requirejs compatibility (#2283) 2022-03-20 10:04:47 -07:00
Hood Chatham 0e1e2ac01c
Python 3.10 (#2225) 2022-03-17 15:48:56 -07:00
Hood Chatham 918fe4c716
Remove Py2JsResult (#2277) 2022-03-17 09:15:09 -07:00
Hood Chatham 245e8e7a5c
Don't expose loadPyodide as global variable from ES6 module (#2249) 2022-03-15 18:59:35 -07:00
Gyeongjae Choi 5bd042f6f7
Refactor matplotlib tests (#2271)
* Fix dangling webdriver

* Embed humor sans font

* Refactor matplotlib testing codes

* Trigger CI

* Trigger CI

* Catch error when import from js fails

* Update changelog

* Apply suggestions from the review
2022-03-16 09:39:34 +09:00
Hood Chatham f7b0f8c5cb
No replay (#2256)
Our package build process currently has a significant flaw: we first run setup.py, recording all compilation commands, then we rewrite these compilation commands to invoke emcc and replay them, and then we pray that the cross compiled executables ended up in the right place to go into the wheel. This is not a good strategy because the build script is allowed to implement arbitrary logic, and if it moves, renames, etc any of the output files then we lose track of them. This has repeatedly caused difficulty for us.

However, we also make no particularly significant use of the two pass approach. We can just do the simpler thing: capture the compiler commands as they occur, modify them as needed, and then run the fixed command.

I also added a patch to fix the numpy feature detection for wasm so that we don't have to include _npyconfig.h and config.h, numpy can generate them in the way it would for a native build. I opened a numpy PR that would fix the detection for us upstream:
numpy/numpy#21154

This clears the way for us to switch to using pypa/build (as @henryiii has suggested) by removing our dependence on specific setuptools behavior.

This is on top of #2238.
2022-03-13 11:39:06 -07:00
Hood Chatham 6defff318f Update main branch changelog to include v0.19.1 2022-03-13 08:13:59 -07:00
Hood Chatham 0a9153e7c6
Add cryptography, openssl, and _ssl packages (#2263) 2022-03-11 22:05:36 -08:00
Jo Bovy 3002751887
Update astropy to 5.0.2 (#2268) 2022-03-10 21:14:49 -08:00
Hood Chatham 74e6809da1
Update lxml (#2239) 2022-03-09 21:36:01 -08:00
Hood Chatham 17fdd6cf64
Fix typo in docs [skip ci] (#2264) 2022-03-09 20:33:25 -08:00
Henry Schreiner 4f8b0a0344
chore: more pre-commit checking (#2257) 2022-03-07 21:51:20 -08:00
Hood Chatham fff0f0e9b0
Add `default_converter` argument to `to_js` and `toJs` (#2208) 2022-03-05 12:32:04 -08:00
Hood Chatham 9feb50bb48
Remove numpy patches work around for chrome 89 bug (#2171) 2022-03-04 16:09:51 -08:00
Gyeongjae Choi fd8433a013
MAINT Refactor benchmark script (#2227)
One can select which benchmark (pystone, numpy, matplotlib, or all) to be run through command-line arguments.
We can divide each benchmark to separate CI jobs in the future if needed.
Moved pystone benchmark to benchmark directory, preventing it from being included in Pyodide release.
2022-03-02 10:11:36 -08:00
LeoPsidom 8798e1f2fd
Use ESM import in module type webworker (#2220)
Co-authored-by: root <root@ip-172-31-32-133.us-east-2.compute.internal>
2022-03-02 00:31:41 -08:00
Henry Schreiner 8d00451142
chore: enable the rest of flake8 & bugbear (#2216) 2022-02-27 12:39:53 -05:00
gabrielfougeron 57a41af118
DOC Corrected sha256 doc (#2213) 2022-02-25 21:45:11 +09:00
Henry Schreiner 8385df36a4
tests: enabling mypy on untyped defs (#2204) 2022-02-23 17:10:53 -05:00
Henry Schreiner 66856a7427
MAINT isort (#2200) 2022-02-21 23:27:03 +01:00
Henry Schreiner ed22c06e07
chore: pyupgrade 3.9+ (#2195) 2022-02-20 17:13:37 -05:00
Henry Schreiner 1a8514d4a8
Add boost-histogram (#2174)
Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
Co-authored-by: Roman Yurchak <rth.yurchak@gmail.com>
2022-02-19 10:18:46 +01:00
Roman Yurchak c11fabc479
Fix pre-commit CI (#2191) 2022-02-19 09:33:49 +01:00
Henry Schreiner 41b6db1bab
style: improve pre-commit (#2177) 2022-02-19 09:06:25 +01:00
Hood Chatham 30ea13fbbf
Support for C++ exceptions in packages (#2178) 2022-02-19 08:31:19 +01:00
Gyeongjae Choi 1041e8ebee
Pin markupsafe version (#2183) 2022-02-18 07:55:33 -05:00
Gyeongjae Choi 55fbd32ef3
ENH Show informative error message when fetching wheel fails (#2175)
Co-authored-by: Roman Yurchak <rth.yurchak@gmail.com>
2022-02-15 12:20:24 +01:00
Hood Chatham 32f9d791be
Add default_converter argument to to_py (#2170) 2022-02-14 15:15:28 -05:00
Hood Chatham 39e028136a
MAINT Add Hiwire to top level namespace (#2173) 2022-02-14 09:20:15 -05:00
Hood Chatham f784e5e3d0
Use wheels instead of sdists for pure Python packages (#2126) 2022-02-12 16:44:10 -05:00
Hood Chatham 2b75cd685b
Add wrapt (#2165) 2022-02-12 16:32:29 -05:00
Paul Korzhyk 33ab51a4ed
DOC Fix typo in packages path [skip ci] (#2146) 2022-01-30 12:05:53 +01:00