Commit Graph

2702 Commits

Author SHA1 Message Date
Gyeongjae Choi 71d466df2f
DOC Fix version warning CSS (#3533)
Close https://github.com/pyodide/pyodide/issues/3513
2023-02-04 14:49:11 +01:00
Gyeongjae Choi f943739e8f
ENH Add --no-deps parameter to build-recipes CLI (#3520)
This adds `--no-deps` parameter to `pyodide build-recipes` CLI, which is a replacement for `pyodide_build buildpkg` entrypoint.

Ref: https://github.com/pyodide/pyodide/issues/2879
2023-02-03 21:31:46 -08:00
Gyeongjae Choi 01e0c92380
Add package_type field to repodata.json (#3528)
This PR adds `package_type` field to repodata.json and use it to create a list of
unvendored standard libraries. After this we don't need to manage a hard-coded
list of unvendored stdlib lists in pyodide-py.
2023-02-03 21:26:23 -08:00
Gyeongjae Choi 66812b8295
CI Show compressed size of main modules after build (#3526)
This adds a short helper script which shows a gzip and brotli compressed size of a file,
and uses it in CI to check compressed size of pyodide.asm.* after build in addition to
the original file size.
2023-02-03 21:25:38 -08:00
Gyeongjae Choi c633565983
Fix console.html url in docs (#3532) 2023-02-02 10:39:42 +09:00
Hood Chatham 20e92c37ca
DOCS, MAINT: Replace :any: xrefs with more specific types (#3531)
This leads to more consistent rendering (functions and methods get parens after
them) and reduces chances of warnings about getting the wrong link. It is also
possible to use `~fully.quallified.name` to just show `name` if we use a specific
reference type, but it doesn't work with `any` for some reason.
2023-02-01 11:00:58 -08:00
Gyeongjae Choi dcdc1e6941
Unvendor pydoc_data and _pydecimal (#3525)
Removes / unvendors some python modules:

- Remove `_aix_support.py`, which is for supporting IBM AIX OS.

- Unvendor `_pydecimal.py`.
  - _pydecimal is a pure Python implementation of `decimal` module. [Importing `decimal` fallbacks](https://github.com/python/cpython/blob/main/Lib/decimal.py) to `_pydecimal` if the C-implementation `_decimal` is not available. In our case, _decimal is available, so _pydecimal will not be normally used. 

- Unvendor `pydoc_data`.
  - pydoc_data contains [a large (~700KB) dictionary](https://github.com/python/cpython/blob/main/Lib/pydoc_data/topics.py) for explaining python builtins. This is mostly used when `help("...")` is called.
2023-02-01 11:00:17 +09:00
Gyeongjae Choi f4f097542c
Fix misplaced changelog entry [skip ci] (#3527) 2023-02-01 10:18:10 +09:00
Gyeongjae Choi db4f068d54
Xfail richcmp test (#3519) 2023-01-31 16:41:20 +09:00
Roman Yurchak 2ee73d397c
CI Fix isort in pre-commit (#3521) 2023-01-30 22:05:48 +01:00
Gyeongjae Choi 570e69ad4f
Add BuildArgs class to store common build arguments (#3514) 2023-01-30 13:35:18 +09:00
Gyeongjae Choi f50c749c9a
Apply upstream cpython commits to relocate test directories (#3507) 2023-01-30 13:34:33 +09:00
Hood Chatham 6816fe9bb1
MAINT Remove "use strict" pragmas from source code (#3518)
We insert these at the top of the file with sed. It's redundant to put them in individual functions.
2023-01-29 18:07:01 -08:00
Gyeongjae Choi 16d494b22b Disable AUTO_JS_LIBRARIES and AUTO_NATIVE_LIBRARIES flags (#3505) 2023-01-30 10:43:34 +09:00
Hood Chatham eb2ffeb660
Add compiled mypy (#3504) 2023-01-27 20:05:49 -08:00
Hood Chatham 122facf069
Emscripten 3.1.31 (#3517) 2023-01-27 20:05:21 -08:00
Hood Chatham cca5e9f87f
Add pynacl (#3500)
Resolves https://github.com/pyodide/pyodide/issues/3327
2023-01-27 16:36:46 -08:00
Gyeongjae Choi 328a9ffc34
Add tag key in meta.yaml spec (#3444)
Co-authored-by: Roman Yurchak <rth.yurchak@gmail.com>
Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
2023-01-27 13:31:26 +09:00
Hood Chatham 2ab4b0ab6a
Install autoconf 2.71 in the docker image (#3515)
Upstream libffi requires autoconf 2.71, so we should use it too.
2023-01-26 19:30:13 -08:00
Hood Chatham 5e26d9f1ae
Build libpyodide.a (#3335)
This is work towards unvendoring the Pyodide foreign function interface. 

Prior to this point, we included a large amount of critical functionality with `--pre-js`.
So we could create an archive called `libpyodide.a` with the object files but to use it
you would have to pass `--pre-js _pyodide.out.js` at link time. This embeds all of this
stuff in an object file called `pyodide_pre.o` which goes in our archive so you get all
the needed js runtime by linking it. 

Of course someone trying to use this still has to get the Python code onto the import
path, either using `--preload-file`, using Python to unpack it as a zip archive as we now
do, with zipimporter, or otherwise. They also will have to link `libpython.a` (is CPython
going to start distributing an Emscripten libpython?) and probably various other things.

We have to use a hack to inject the JavaScript code into the object files. The normal
`EM_JS` macro cannot handle arbitrary JavaScript code -- for example it fails with many
regex. Instead we manually generate write a C source file that does what we need using
`xxd`. The generated C code is similar to what `EM_JS` generates, but it uses an array
initializer rather than a string initializer for the characters avoiding the C preprocessor /
compiler's strange opinions about strings.
2023-01-26 17:22:05 -08:00
Hood Chatham 441cddea0c
Refactor conf.py (#3512)
Instead of putting stuff behind `IN_SPHINX`, define functions and call them from the `setup` function. 
In these functions, if we want to expose variables as part of the config we have to assign to `app.config.some_var` which is more explicit.

We still have to make the path change at top level. To improve this, in the future we should:
1. rename the sphinx_pyodide folder to sphinx-pyodide
2. add a `pyproject.toml` and `setup.py` so we can `pip install -e` it
3. instead of modifying the path, source the virtual environment
2023-01-26 15:36:22 -08:00
Hood Chatham 74686832b9
ENH Make JS Errors work like other special JS types (#3455)
Up to this point, we've used this dynamic subclassing method for
producing JsProxies for everything but errors. For errors, we make
a wrapper which is not a JsProxy that inherits from Exception and
give the wrapper a "js_error" attribute that points to an actual
error. We also make python2js know about this wrapper so it can
unwrap it. But the raw js_error object is a bit weird. There isn't
anything terrible about this situation but it is mildly unsatisfying.

This changes it so that errors subclass both JsProxy and Exception.
To do this we need to:
1. ensure that they have compatible memory layouts, and
2. convince Python that they have compatible memory layouts

I switched to using a union for the different subtypes of JsProxy
that need extra space: JsCallable, JsBuffer, and JsError. We need
js to be at the end so it won't get in the way of the BaseException
memory layout. I added _Static_asserts to double check that the
memory layouts do in fact agree.

To convince Python that they have compatible memory layouts, we have
to temporarily tell it that JsProxy is a subtype of BaseException.
To do this, we just set JsProxy.__mro__ = (BaseException,) before
creating the type and then restore it afterward.
2023-01-26 11:08:46 +09:00
Hood Chatham 9161c34fb3
Reorder changelog for 0.22.1 (#3509) 2023-01-25 15:58:09 -08:00
Hood Chatham c06f4d5dfb
DOCS Fix console.html deploy (#3510)
Put `console.html` in `app.outdir`.

This was needed because readthedocs/readthedocs.org PR 9888 moved the outdir
2023-01-25 09:31:06 -08:00
Hood Chatham 1c2bf92a3f
Improve messages in case of system exit (#3496)
This prints a better set of error messages in case someone calls os._exit() or in C code exit() is used.
In the future we might like to do something better here, but for now at least we can print a clear
error message.
2023-01-24 18:11:11 -08:00
Hood Chatham 8c5ae6ff9e
Update description of github releases in docs (#3498) 2023-01-24 13:11:31 -08:00
Hood Chatham b3d4688818
Xfail the urllib test in safari (#3502) 2023-01-24 11:46:24 -08:00
dependabot[bot] 1b6a29bc02
Bump ua-parser-js from 1.0.2 to 1.0.33 in /src/js (#3501) 2023-01-24 09:10:23 -08:00
pre-commit-ci[bot] 7ad5c15690
[pre-commit.ci] pre-commit autoupdate (#3400) 2023-01-24 08:00:05 -08:00
Hood Chatham 036f9cb545 Revert "0.23.0a1"
This reverts commit 2eaee0673d.
2023-01-24 07:30:10 -08:00
Hood Chatham 3268fae55e
Add a types field to package.json (#3499)
Resolves https://github.com/pyodide/pyodide/issues/3164
2023-01-24 09:46:21 +01:00
Hood Chatham 2eaee0673d 0.23.0a1 2023-01-23 21:45:09 -08:00
Hood Chatham 3b2952fc92
Python3.11 (#3252) 2023-01-23 19:45:59 -08:00
Hood Chatham 3f845c87a1
Pass same environment variables to out of tree builds as in tree ones (#3495)
Resolves https://github.com/pyodide/pyodide/issues/3493
2023-01-23 17:09:31 -08:00
Hood Chatham d3c2a6dfa8
Fix setStdin to insert a null after each buffer if autoEOF parameter is true. (#3488)
Resolves https://github.com/pyodide/pyodide/issues/3413
2023-01-23 17:07:59 -08:00
Hood Chatham dc514421ad
DOCS Build emsdk before python (#3489) 2023-01-24 09:11:22 +09:00
TheOnlyWayUp 47fad2e91f
DOCS Update micropip docs link on Website (#3494)
[skip ci]
2023-01-23 17:58:38 +01:00
Alexey Ignatiev 3c92574c57
Another update of python-sat. (#3468) 2023-01-22 22:22:53 -08:00
Hood Chatham 485e806383
Make sure pyodide config doesn't output anything extra (#3483)
Resolves https://github.com/pyodide/pyodide/issues/3430
2023-01-22 08:24:58 -08:00
Hood Chatham af4158da77
Don't check emscripten version when creating pyodide venv (#3485)
Resolves https://github.com/pyodide/pyodide/issues/3472
2023-01-22 08:21:03 -08:00
Hood Chatham 1b2375f76c
Fix `from pyodide.ffi import *` (#3484)
Also remove almost everything from `_core.py` and moves it to `ffi/__init__.py`.
Micropip imports `IN_BROWSER` from `pyodide._core` so we leave that in there.

Resolves https://github.com/pyodide/pyodide/issues/3432
2023-01-22 08:19:48 -08:00
Hood Chatham 8a26af4f76
DOCS Improve JavaScript type rendering (#3481) 2023-01-22 09:26:42 +01:00
Gyeongjae Choi 8d7137f112
Fix incorrect error messages in ModuleNotFoundError (#3435)
Close https://github.com/pyodide/pyodide/issues/3423
2023-01-22 09:20:19 +01:00
Hood Chatham 94b933b717
Remove optional requirements from lxml meta.yaml (#3482) 2023-01-22 09:13:01 +01:00
Hood Chatham 69d7b4e099
Remove napoleon_fixes (#3479)
I upstreamed all of this into sphinx-autodoc-typehints.
2023-01-21 17:44:20 -08:00
Hood Chatham 6972ff101d
DOCS Add sphinx cross referencing to MDN docs using intersphinx (#3477) 2023-01-20 11:21:44 +09:00
Deepak Cherian 9323d19dc2
Update xarray to 2023.01.0 (#3476) 2023-01-18 17:05:52 -08:00
Hood Chatham 2801ffb0db
More updates to docstrings (#3466)
I added a new decorator called `@docs_argspec` to override the argument specification
of a function used in the docs by setting `func.__wraps__` to a fake function. This only
happens when building the docs, normally it is a no-op.

`@docs_argspec` is needed when using `@overload` because mypy requires the argspec
of the main function to be at least as general as the argspecs of all the overloads, which
causes suboptimal rendering in the api docs.
2023-01-18 14:13:37 -08:00
Hood Chatham 9b58bf4294
DOCS Remove ensure_argument_types and use autodoc-typehints feature for this (#3475)
Turns out there was a setting for this. Should have read the docs!
2023-01-18 14:13:17 -08:00
Gyeongjae Choi 9afb50a03e
Update jquery terminal version in console.html to 2.35.2 (#3474) 2023-01-18 10:14:15 +01:00