Commit Graph

317 Commits

Author SHA1 Message Date
Gyeongjae Choi b801885353
Out-of-tree recipe build support (#3544)
Add out-of-tree support for `pyodide build-recipes` command.
This mostly reuses xbuildenv we use for the out-of-tree build.
2023-03-23 14:01:27 +09:00
Roman Yurchak 601d939fdd
Fix wheel compression with the JsDelivr CDN (#3667)
Set the MIME type for wheels and zip files to application/wasm to enable CDN compression. Also optionally disable compression in zip files and wheels to make the brotli compression by the CDN more efficient.

Co-authored-by: Gyeongjae Choi <def6488@gmail.com>
2023-03-21 09:11:47 +01:00
Roman Yurchak 59b2c4e1ef
Remove deprecated pyodide-build buildall and mkpkg CLI endpoints (#3668) 2023-03-20 08:43:04 +01:00
Gyeongjae Choi 802a9cd26b
Handle response files in pywasmcross (#3645)
Co-authored-by: josephrocca <1167575+josephrocca@users.noreply.github.com>
2023-03-17 09:00:51 +09:00
Loïc Estève 4028757968
Fix arpack *eupd issues due to numpy 1.24 f2py changes (#3658) 2023-03-17 08:59:16 +09:00
Christian Clauss 57f36ac6f8
Ruff is now compatible with Python pattern matching (#3650) 2023-03-13 22:45:06 +01:00
Gyeongjae Choi a9182030cd
Merge pyodide_py into python_stdlib.zip (#3621)
Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
2023-03-04 11:05:12 +01:00
Joe Marshall 0fdf9a80fa
Add Fastparquet (#3590) 2023-03-02 14:46:58 +09:00
Gyeongjae Choi 61f3d35eca
Pin types-setuptools version (#3613) 2023-02-28 10:46:00 +01: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 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 994ce5111f
BLD Add DISTDIR variable (#3584) 2023-02-17 08:25:42 +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 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
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
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
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
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 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 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 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 036f9cb545 Revert "0.23.0a1"
This reverts commit 2eaee0673d.
2023-01-24 07:30:10 -08: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 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
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
Gyeongjae Choi 5523b1397f
Implement pycompile option in pyodide create-zipfile CLI (#3463) 2023-01-18 10:00:18 +01:00
Gyeongjae Choi fa8289eb11
MAINT Relocate functions in pywasmcross (#3464) 2023-01-17 13:31:45 +09:00
Gyeongjae Choi eb7b80bb3e
Replace print statements with rich in pyodide-build (#3442) 2023-01-16 13:46:38 +09:00
Gyeongjae Choi 0483a6bbf0
Remove a duplicated test in test_cli (#3454) 2023-01-16 13:19:06 +09:00
Gyeongjae Choi ae4492a1fd
Add a CLI command to create a zipfile of Python libraries (#3411)
Co-authored-by: Roman Yurchak <rth.yurchak@gmail.com>
2023-01-14 14:59:42 +01:00
Gyeongjae Choi 094a6dafcf
FIX Append --fresh flag to let cmake ignore existing cache (#3445)
Resolve https://github.com/pyodide/pyodide/issues/3425
2023-01-13 18:41:29 +01:00
Gyeongjae Choi ef112108c9
Add rust toolchain to the pyodide-env docker image (#3441)
This adds rust toolchain into our docker image so we don't have to install it every time.

make rust command still exists, but I removed it from the docs. So now a user (who wants to build a package that requires rust) is responsible for installing rust toolchain in their build setup, which is reasonable I think.

Co-authored-by: josephrocca <1167575+josephrocca@users.noreply.github.com>
Co-authored-by: Roman Yurchak <rth.yurchak@gmail.com>
Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
2023-01-10 13:28:04 +09:00
josephrocca fd49100981
Ignore --exclude-libs link flag (#3434) 2023-01-09 08:21:37 +09:00
Joe Marshall 76581a7d28
Get deps from pypi during build (#3310) 2023-01-05 08:45:20 +09:00
Roman Yurchak e8f8324eb2
Add CLI command to py-compile wheels (#3253)
Co-authored-by: Gyeongjae Choi <def6488@gmail.com>
2023-01-04 17:07:07 +02:00
Gyeongjae Choi 8e965e57d4
0.22.0 (#3389)
Co-authored-by: Roman Yurchak <rth.yurchak@gmail.com>
2023-01-03 20:34:25 +09:00
Loïc Estève 84496124d2
Fix scipy build with gfortran >= 10 (#3401) 2023-01-03 11:20:26 +09:00
Gyeongjae Choi 03161e530c
Fix broken pyodide cli tests (#3390) 2022-12-29 18:37:16 +09:00
Gyeongjae Choi c3647f7e5d
Pin range of auditwheel-emscripten version (#3388)
So we can fix bugs in auditwheel-emscripten without releasing a new version
of pyodide-build
2022-12-26 20:02:18 -08:00
Gyeongjae Choi 2f1716b575
Relocate files inside tools directory (#3358)
This PR relocates files inside `tools` directory so that `tools` directory doesn't
have to be vendored when creating xbuildenv.

- cmake, pyo3 config ==> moved to `pyodide-build`.
- venv python script ==> moved to templates, then copied to dist during build.
2022-12-26 20:00:24 -08:00
Gyeongjae Choi ab93a0d747
Add `pyodide config` command to show config variables used in Pyodide (#3376) 2022-12-23 09:20:23 +01:00
Gyeongjae Choi 290bb657cf
Update auditwheel-emscripten version to 0.0.9 (#3383) 2022-12-23 14:29:31 +09:00
Roman Yurchak fdbcc087e2
Add Pyodide CLI documentation (#3367)
Co-authored-by: Gyeongjae Choi <def6488@gmail.com>
2022-12-22 11:24:28 +01:00
Hood Chatham faaa4e0aaa
Fix version comparison in mkpkg update (#3364) 2022-12-18 11:14:24 +01:00
Gyeongjae Choi 0709ec0a26
Split building and installing packages in buildall (#3279) 2022-12-15 13:43:39 +09:00
Roman Yurchak f0189de3f5
PKG Add pyodide-http (#3355) 2022-12-15 11:31:00 +09:00
Gyeongjae Choi d0f1f7142b
Rename unvendored _hashlib to hashlib (#3349) 2022-12-14 09:05:17 +01:00
Hood Chatham 29323915c3
Add a typeshed for the js module (#3298)
Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
2022-12-02 09:16:16 +01:00
Gyeongjae Choi c4a4ecbb04
Remove opencv-python fix in pywasmcross (#3307) 2022-11-30 17:04:18 +01:00
Gyeongjae Choi cc7a734c49
Add `requirements/executable` key in meta.yaml spec (#3300)
Adds a new key in meta.yaml spec: requirements/executable which specifies the list of executables required to build a package. Unlike conda, we don't build or install these executables. This key exists just to halt build earlier

Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
2022-11-30 16:40:36 +09:00
Gyeongjae Choi 6bf2550b67
Support loading shared libraries inside a wheel file globally (#3264) 2022-11-29 13:40:33 +09:00
Gyeongjae Choi 923aea8221
Pin setuptools version (#3278) 2022-11-21 16:03:53 +09:00
Joe Marshall 4a1913d3ad
build packages from pypi direct (#3196)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
Co-authored-by: Gyeongjae Choi <def6488@gmail.com>
Co-authored-by: Roman Yurchak <rth.yurchak@gmail.com>
2022-11-17 10:05:14 +09:00
Gyeongjae Choi 3ad41f13c7
Merge library and sharedlibrary key to build/type (#3238) 2022-11-13 12:31:14 +09:00
Hood Chatham f144514534 Revert "Version 0.22.0a3"
This reverts commit 0b4e19dbe1.
2022-11-10 11:15:57 -08:00
Hood Chatham 0b4e19dbe1 Version 0.22.0a3
Only difference between this and 0.22.0a2 is the sys.exit fix for
the command line runner (#3241). Just trying to get Pyodide working
in numpy CI...
2022-11-10 07:25:29 -08:00
Hood Chatham 9952a86f0f Revert "Version 0.22.0a2"
This reverts commit ef64c06f5b.
2022-11-09 19:15:51 -08:00
Hood Chatham ef64c06f5b Version 0.22.0a2 2022-11-09 13:09:59 -08:00
Hood Chatham 2cd616d441
Add support for loading .so files in command line runner (#3098)
This is needed to finish getting numpy tests working.

It won't work for packages that need shared libraries without some extra intervention.
ryanking's work in #3234 would help to fix this.

pip install scipy makes the command line runner extremely slow. Without scipy installed,
python -c 'print(1)' runs in about 1 second, but with it installed it takes more like 10 seconds
(time to load clapack_all.so and 111 different .so files in scipy, totaling 20 megabytes). We
have to load all of this despite the fact that we won't use any of it.
2022-11-09 13:05:01 -08:00
Gyeongjae Choi af206d159c
Add vendor-sharedlib key in meta.yaml spec (#3234) 2022-11-09 20:18:44 +09:00
Hood Chatham 3dfe5b35ef
Emscripten 3.1.23 (#3148) 2022-11-07 08:51:24 -08:00
Gyeongjae Choi 3bb7b95b98
Fix CLAPACK install path (#3224) 2022-11-04 11:04:50 +09:00
Gyeongjae Choi f7bb2489f9
Fix copying shared libraries after build (#3212)
This fixes two minor bugs when building packages:

- Shared libraries are not copied into dist directory when it is already built.
- When build fails, the shared library zip file remains in the package directory.

Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
2022-11-01 10:41:44 +09:00
Gyeongjae Choi f48893c33a
Add _hashlib to unvendored stdlib (#3206) 2022-10-26 10:59:01 +09:00
Gyeongjae Choi b610f2c7e0
Add `pyodide skeleton` command (#3175) 2022-10-25 14:52:11 +09:00
Gyeongjae Choi 6214bafe5d
BLD Retry when package download fails (#3157) 2022-10-05 14:23:13 +09:00
Gyeongjae Choi d2fce73291
Prevent backend-flags from propagating to dependencies (#3153) 2022-10-04 08:57:24 +09:00
Gyeongjae Choi 90e20badd7
Prevent from searching meta.yaml recursively inside extracted package source directory (#3162)
This fixes the behavior of searching meta.yaml recursively inside the extracted package source directory.
It sometimes cause error on packages that contain local meta.yaml file due to conda support.
2022-09-30 15:09:45 +09:00
Gyeongjae Choi 83ba807b10
Handle shared libraries with version suffix (#3154) 2022-09-30 11:06:41 +09:00
Yizhi Liu f28bf95c84
Add lightgbm package (#3138) 2022-09-27 10:14:11 +09:00
Hood Chatham 9a3365a6d0 Revert "0.22.0a1"
This reverts commit 13526ac8ff.
2022-09-24 18:37:03 -07:00
Hood Chatham 13526ac8ff 0.22.0a1 2022-09-24 18:36:46 -07:00
Gyeongjae Choi c54328cb1b
Use pyodide-cli entrypoint for out-of-tree CLI (#3140) 2022-09-24 18:34:36 -07:00
Gyeongjae Choi a916ea0b34
BLD simplify building CMake based packages (#3128)
This PR makes building CMake based packages easier.
- Introduce a custom toolchain file for Pyodide. It inherits most of settings from the original Emscripten toolchain file with some modifications. Packages built by pyodide-build will automatically use that toolchain file.
- Proxy cmake in pywasmcross.py, in order to proxy other compiler toolchains.
2022-09-22 10:42:26 +09:00
Gyeongjae Choi 024dcbe8f0
CI Fix ccache in package build (#3104) 2022-09-21 09:30:09 +02:00
Hood Chatham 09af24b3b5
DOCS Add docs for out of tree builds (#3109) 2022-09-18 17:36:12 -07:00
Hood Chatham 3765b51841
Fix pyodide venv install from local file system for pure Python packages (#3108)
Currently `pip` can't invoke the Pyodide build backend, but it should still be
able to build pure Python packages from source. To allow this, we need to
restore `_PYTHON_SYSCONFIGDATA_NAME` so that it isn't inherited by
subprocesses. Otherwise, they will fail to import `sysconfig` because the
subprocess doesn't have our altered `sys.path`. Annoyingly, when pip invokes
the subprocess it seems to pass `_PYTHON_SYSCONFIGDATA_NAME` down
but not `PYTHONPATH` so just setting the `PYTHONPATH` isn't good enough.
2022-09-18 09:21:02 -07:00
Hood Chatham fc8503d2de
Add create_index to create a pypa simple index and use it with xbuildenv (#3096)
Pyodide virtual environments created from release versions of Pyodide
will use this package index to install packages from jsdelivr.
2022-09-13 20:19:01 -07:00
pre-commit-ci[bot] efcca8be91
[pre-commit.ci] pre-commit autoupdate (#2928) 2022-09-13 15:12:40 -07:00
Gyeongjae Choi 2dc937c0b6
Enable libhdf5 and h5py (#2812) 2022-09-13 16:17:52 +09:00
Gyeongjae Choi 6d5de461a5
Proxy ranlib and strip (#3082) 2022-09-13 13:19:44 +09:00
Hood Chatham b6d3281d67
Add command to create Pyodide virtual environment (#2976)
Inside the generated virtual environment, `python` will use node to run Pyodide.
Pip can be used to install packages into the environment.
2022-09-12 11:18:40 -07:00
Roman Yurchak 4dd8a3e0cb
Switch to meta.yaml parsing with pydantic (#3079) 2022-09-11 09:20:56 +02:00
Gyeongjae Choi 555f7828f4
Parse top-level import name from wheel file (#3006) 2022-09-06 15:20:04 +09:00
Hood Chatham 525b5a1785
Update scipy to 1.9.1 (no meson) (#3043)
This updates scipy to v1.9.1. This was mercifully easy:

* for now we disable meson
* we dropped `patches/0014-BUG-Fix-signature-of-D_IIR_forback-1-2.patch` since it was upstreamed
* we had to add a patch to put fitpack back into a shape that makes f2c happy
* we need one more `-Wincompatible-function-pointer-types` fix upstream PR: https://github.com/scipy/scipy/pull/16934
2022-09-04 22:39:32 -07:00
Gyeongjae Choi e4bc821d35
Raise error when static libraries are specified as a runtime dependency (#3055) 2022-09-04 12:53:09 +02:00
Gyeongjae Choi 09aa16a9a0
Load packages in a topologically sorted order (#3020)
This commit changes how we load packages.

Before, we loaded all shared libraries first then all Python packages.
All shared libraries / Python packages were loaded in a random order,
which might cause a problem if there is a load-time dependency between libraries or between packages.

Now we load them in a topologically sorted order regarding dependencies.
2022-09-02 10:19:42 +09:00
Hood Chatham e6e7d56752
MAINT Remove custom setuptools_rust commit (#3045) 2022-08-30 17:29:25 -07:00
Gyeongjae Choi 6964672556
Fix incorrect package name of ruamel.yaml (#3036) 2022-08-30 16:25:13 +09:00