Commit Graph

81 Commits

Author SHA1 Message Date
Gyeongjae Choi ed3b787b60
BLD Extract out package build configs from Makefile.envs (#4708) 2024-04-27 11:30:06 +09:00
pre-commit-ci[bot] 6f7ae21aa8
[pre-commit.ci] pre-commit autoupdate (#3736) 2024-04-04 09:21:19 +02:00
Hood Chatham 7ca959f0f7
Put pyodide version into xbuildenv name (#4222)
This should reduce the likelihood of accidentally using an xbuildenv for the
wrong Pyodide version.
2024-02-17 12:45:32 -08:00
Hood Chatham b8287e42d9
chore: Update pre-commit (#4440)
I also reordered prettier to come last since it's the slowest. I switched from
using black to ruff-format which says its defaults are nearly the same as black.
2024-01-28 13:20:08 -08:00
Martoxa b7f86248fa
Add function to check for WASM magic number (#4018)
This adds `check_wasm_magic_number` to`pyodide_build` which checks whether a file starts 
with the wasm magic number `b"\0asm"`.
2023-07-26 22:53:08 -07:00
Juniper Tyree 0980b51677
Implement PEP 658: .whl.metadata files (#3981) 2023-07-17 21:17:24 +09:00
Gyeongjae Choi 8cd338b629
MAINT Relocate build environment management related methods (#3934)
Relocates methods that are related to the build environment management (common.py ==> build_env.py)
2023-06-26 21:20:12 +09:00
Hood Chatham 9012711ba0
Run replace_so_abi_tags on out of tree builds (#3927) 2023-06-17 13:39:33 -07:00
Gyeongjae Choi 1691d347d1
Don't set PYODIDE_ROOT inside xbuildenv installation function (#3922)
This is some cleanup after #3883.

- Make the `PYODIDE_ROOT` be modified only inside the `init_environment` function.
- Removes `__LOADED_PYODIDE_ENV`. I think it is redundant as we use `PYODIDE_ROOT` for a similar purpose.
2023-06-15 17:30:52 +09:00
Hood Chatham ffa2dd7036
NFC Factor out common setup for rust packages (#3908) 2023-06-07 08:45:26 -07:00
Gyeongjae Choi 73c497bfbe
Remove in-tree dependency when building unvendored python modules (#3864) 2023-06-05 19:48:48 +09:00
Gyeongjae Choi 4a7cc0c20e
Merge initialization functions for in-tree and out-of-tree builds (#3883) 2023-06-05 17:34:07 +09:00
Gyeongjae Choi 19886f8bd6
Make build variables accessible only through the API (#3765)
This PR makes build variables only accessible through the API, instead of polluting os.environ.

I also changed the API as below, as a preparation to move away from makefiles.

- `get_make_environment_vars` => `get_build_environment_vars`
- `get_make_flag` => `get_build_flag`
2023-05-06 17:17:22 +09:00
Gyeongjae Choi 6213477940
Make sure PYODIDE_ROOT points to absolute path in out-of-tree build (#3751) 2023-04-11 13:05:11 +09:00
Hood Chatham d5d2396f6a
Fix set_build_environment so that it works even if HOME is unset (#3744)
I'm running into a crash in cibuildwheel where some of its CI environments don't set HOME. This fixes set_build_environment to be a bit more resistant against crashes due to missing environment variables.
2023-04-08 19:34:10 +02:00
Roman Yurchak 8058cb6703
Support for py-compiling folders + repodata.json update (#3700)
Co-authored-by: Gyeongjae Choi <def6488@gmail.com>
2023-03-28 11:28:28 +00: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
Joe Marshall 0fdf9a80fa
Add Fastparquet (#3590) 2023-03-02 14:46:58 +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 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
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 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
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 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
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 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 d0f1f7142b
Rename unvendored _hashlib to hashlib (#3349) 2022-12-14 09:05:17 +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 f48893c33a
Add _hashlib to unvendored stdlib (#3206) 2022-10-26 10:59:01 +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
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
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
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 b4433e1b4a
Do not load unvendored stdlibs by default (#2998)
As discussed in #2940, this PR changes the default value of the fullStdLib flag in loadPyodide to false.
This is a breaking change because for now distutils is not loaded by default.
Also, when fullStdLib is set to true, it loads all unvendored stdlibs except for test.

Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
2022-08-23 11:52:27 +09:00
Gyeongjae Choi 26535e33cd
Unvendor sqlite3 from stdlib (#2946)
Unvendor the standard library sqlite3 to reduce the size of the main module. It reduces the size of pyodide.asm.wasm around ~1.4MB.

Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
2022-08-22 08:52:50 +09:00
Hood Chatham b1ab8f0de4
Add an Emscripten version check for out of tree builds (#2975)
The out of tree build system applies an abi tag based on `PYODIDE_EMSCRIPTEN_VERSION`
in `Makefile.envs`. Prior to this PR, it will happily accept the version of emscripten (say 3.1.18)
and produce a wheel tagged like it was produced from the expected Emscripten version (say 3.1.14).
This causes confusing errors due to ABI mismatch see igraph/python-igraph#560. This error message
should help prevent such confusion.
2022-08-18 09:28:10 +02:00
Gyeongjae Choi 26e45657a7
MAINT Build test and distutils stdlib modules with pyodide-build (#2979) 2022-08-18 13:55:16 +09:00
Gyeongjae Choi 6acd1dd02b
Add an import hook for unvendored and removed stdlibs (#2973) 2022-08-17 22:03:21 +02:00
Gyeongjae Choi b497ce26ed
Add lzma (#2939) 2022-08-11 17:52:23 +09:00
Gyeongjae Choi 9d874d588b
MAINT Update pre-commit config (#2890) 2022-07-19 16:43:12 +01:00
Hood Chatham 03a05ab36d
Finish out of tree build system (except xbuildenv deploy) (#2823)
This completes the out of tree build CLI. This PR is paired up with:
numpy/numpy#21895
I have also successfully built scikit-learn, statsmodels, pandas, and
astropy with this.

The last thing we need to do after this is set up deployment of the
cross build environment. We can deploy one version to s3 for each
tagged commit. I will do that in a separate PR after this is merged.
2022-07-06 14:37:19 -07:00