Commit Graph

2835 Commits

Author SHA1 Message Date
Christian Clauss 61e13fdf26
Fix pytest warning that find_import() has moved to pyodide.code (#3619)
From pytest warnings summary:
> src/py/_pyodide/_base.py::_pyodide._base.find_imports
  /root/repo/src/py/pyodide/__init__.py:78: FutureWarning: pyodide.find_imports has been moved to pyodide.code.find_imports Accessing it through the pyodide module is deprecated.
2023-03-02 02:07:54 +01:00
Christian Clauss 154fbed9fa
Upgrade to Python v3.11.2 (#3614) 2023-03-01 23:57:17 +01:00
Gyeongjae Choi ed3ae1ba49
Download standard libraries in a zipfile (#3582) 2023-03-01 23:11:30 +01:00
Jeff Glass f3360876be
Add FAQ, Docs for working around JS Objects named like Python Keywords (#3616) 2023-03-01 16:57:08 +09:00
Gyeongjae Choi 61f3d35eca
Pin types-setuptools version (#3613) 2023-02-28 10:46:00 +01:00
Christian Clauss 2adbe0e9d7
Upgrade GitHub Actions (#3608) 2023-02-28 10:10:21 +09:00
Gyeongjae Choi c99584d4b8
FIX Change rust packages not to build concurrently (#3607)
Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
2023-02-27 14:55:03 +09:00
Christian Clauss 01c00d70b4
PEP621: Move pytest configuration into pyproject.toml (#3609)
* PEP621: Move pytest configuration into pyproject.toml

Migrate `setup.cfg` to `pyproject.toml` using [ini2toml](https://pypi.org/project/ini2toml) to do the file conversion and running [validate-pyproject](https://github.com/abravalheri/validate-pyproject) in pre-commit to validate the results.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-02-27 08:33:53 +09:00
Gyeongjae Choi 205deef3cc
Minor opencv-python meta.yaml fix (#3604) 2023-02-23 19:27:28 +09:00
Gyeongjae Choi 9e1e575dfe
Deepfreeze essential parts of the encodings module (#3585) 2023-02-22 18:40:05 +09:00
Gyeongjae Choi 1138a4af2d
Add url parameter to install_xbuildenv (#3592) 2023-02-22 11:56:35 +09:00
Gyeongjae Choi 0d5bd851fe
Use loky.cpu_count() instead of os.cpu_count() (#3598) 2023-02-22 07:53:19 +09:00
Gyeongjae Choi 862e4f8877
MAINT Initialize filesystem in a single point (#3591)
We do several filesystem operations before loading Python.

- Mount _node_mounts
- Create default directories
- Register NativeFS file system

This PR organizes all those operations into a single function.

This is an another split off from #3582.
2023-02-19 18:25:00 -08:00
Gyeongjae Choi 994ce5111f
BLD Add DISTDIR variable (#3584) 2023-02-17 08:25:42 +09:00
messense 0be3c6d9fa
Fix activating pyodide venv command docs (#3586) 2023-02-15 16:34:07 +09:00
Gyeongjae Choi c55bd2a823
Move webbrowser.py into pyodide-py (#3583) 2023-02-14 16:08:28 +09:00
Gyeongjae Choi 5ad2dcf76f
Improve the error message when a meta.yaml file is not found (#3568) 2023-02-14 08:49:52 +09:00
Gyeongjae Choi d4bb0df3fa
Remove some build-only dependencies from meta.yaml (#3576) 2023-02-13 09:56:08 -08:00
Gyeongjae Choi 0b378d6727
Remove globally pinned build requirements (#3577) 2023-02-13 09:55:41 -08:00
Nicholas Bollweg e835bf05ff
add license file and metadata to pyodide-build (#3574) 2023-02-11 13:29:01 -08:00
Gyeongjae Choi 2fb9440e91
BLD Remove _pywasmcross entrypoint (#3566) 2023-02-11 00:04:25 -08:00
Feodor Fitsner 2f305cfec7
Add Flet to Related Projects (#3571) 2023-02-10 12:25:59 -08:00
Gyeongjae Choi b6fc9e7b1d
Add --no-user flag when installing packages in xbuildenv (#3562) 2023-02-10 09:17:53 +09:00
Gyeongjae Choi 68e42b1867
ENH Autodetect the number of cores when invoking `pyodide build-recipes` (#3559)
Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
2023-02-10 08:56:42 +09:00
Gyeongjae Choi 189e49e892
FIX Escape nbsp in console.html (#3558)
Resolves https://github.com/pyodide/pyodide/issues/3337

In Firefox if one writes anything with spaces then tries to copy-paste the input to a standard Python REPL, one gets,

SyntaxError: invalid non-printable character U+00A0

this is because spaces are replaced by the non-breaking space character.

This patch replaces non-breaking space characters with normal space characters in the repl.
2023-02-09 10:34:05 -08:00
Gyeongjae Choi 7cc1058358
Update gitpod config (#3555) 2023-02-08 13:23:26 +09:00
Hood Chatham 84ef7fa76d
Fix isPyProxy so that it works correctly with multiple Pyodide interpreters (#3545)
This removes code so that we use the default `instanceof` behavior.
The added test fatally fails without this patch.
2023-02-07 16:03:43 -08:00
Deepak Cherian 21d941bd34
Update to Xarray 2023.02.0 (#3554) 2023-02-08 08:47:06 +09:00
Roman Yurchak 48258ff146
Replace isort, flake8, pycln and pyupgrade by ruff (#3522)
Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
2023-02-07 08:35:20 +09:00
Hood Chatham 5780584407
Docs: Minor improvements (#3546) 2023-02-06 08:45:12 +01:00
Hood Chatham 861a758c3b
Add new `pyodide.ffi` JavaScript submodule with PyProxy subtypes (#3523)
This creates a new `pyodide.ffi` submodule and adds a bunch of new subclasses of
`PyProxy` to it.

There are three stages in which we are concerned with the behavior of the
objects we define:
1. at time of static typechecks
2. at execution time
3. when generating docs

Prior to this PR, the subtypes of PyProxy only work well for static type checks,
they work acceptably at runtime (just don't let the user access them), and the
docs don't look that great. This PR is primarily intended to improve the docs
for PyProxy, but they also make execution time checks work better: you can now
say `obj instanceof pyodide.ffi.PyCallable` instead of `obj.isCallable()` which
I is easier to understand and to cross reference against the documentation. I am
marking `isCallable` as deprecated.

I also made a bunch of edits and improvements to the docs.

I have deprecated `PyProxyCallable` in favor of `pyodide.ffi.PyCallable` and
`PyProxy.isCallable` in favor of `obj instanceof pyodide.ffi.PyCallable`.
`PyBuffer` has been renamed to `pyodide.ffi.PyBufferView` and a new `PyBuffer`
has been created which is a subtype of `PyProxy`.
2023-02-05 19:35:08 -08:00
Joe Marshall ba3a8d7eb8
Reproducible package builds (and requirements.txt support) (#3469)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-02-04 14:55:09 +01:00
Hood Chatham c221532c8c
Disable NODEJS_CATCH_EXIT (#3542) 2023-02-04 14:50:14 +01:00
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