Commit Graph

123 Commits

Author SHA1 Message Date
Gyeongjae Choi dd9366e30f
BLD Extract out xbuildenv create command from pyodide-build (#4798)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-05-31 18:27:57 +09:00
Gyeongjae Choi c4a6964429
Use Pyodide version instead of pyodide-build version when creating lockfile (#4732)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-05-02 20:32:10 +09:00
Gyeongjae Choi 6fb3d7340c
BLD Add a file holding cross build environment metadata (#4695) 2024-04-20 22:52:37 +09:00
pre-commit-ci[bot] 6f7ae21aa8
[pre-commit.ci] pre-commit autoupdate (#3736) 2024-04-04 09:21:19 +02:00
Hood Chatham 6a1b0b09b6 Add CI job to check that release version matches repo file contents 2024-02-28 14:03:57 -08:00
Hood Chatham df8aa663b0
Reduce the amount of stuff that the makefile always redoes (#4515)
libgl is marked .PHONY and is a dependency for the link step which forces us to always redo the link
step even though it's completely not necessary. I moved embuilder build libgl into the link step
since that's the only place where it's needed.

dist/python_stdlib.zip and dist/pyodide-lock.json both declare a dependency on pyodide_build but
there is never a file of that name so they always have to run. Instead, run make pyodide_build so
that they can reuse the logic but they don't always run if their other deps are satisfied.

Now that dist/python_stdlib.zip doesn't always run it needs to rely on all files in src/py.
Make pyodide_build only invoke pip install if pyodide_build is not already installed. Pip generates
a lot of noise and takes a while so skipping it when we don't need it helps a lot.
Make dist/webworker.js and friends not phony since they stopped needing to be when PYODIDE_BASE_URL
was removed from them.
2024-02-13 15:20:31 -08:00
Hood Chatham 8f71575dcc Fix bump_version pattern for src/py/pyproject.toml 2024-02-05 17:07:32 -08:00
Emil Nikolov 44107e8e78
Replace references to /bin/bash with /usr/bin/env bash (#4478) 2024-02-04 09:54:17 -08:00
Gyeongjae Choi d1628de4ff
TST Move run_docker test outside of pyodide-build (#4463)
It is weird that test_run_docker is inside pyodide-build. This PR moves the
run_docker test file to tools directory. Maybe it is not the best place to put
this test file, but it is at least better than pyodide-build.
2024-02-02 10:46:04 -08:00
Matthias Köppe eb6e03e56c
src/py/pyproject.toml: Move metadata here from setup.cfg (#4472)
Modernizing metadata
2024-02-02 08:32:08 -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
Gyeongjae Choi d4450d9ee3
Pin pytest < 8.0 and make s3 test compatible to moto 5.0 update (#4437)
pytest 8.0 and moto 5.0 were released a few hours ago, and
they seem to be breaking tests. This is a (temporary) fix.
2024-01-28 09:04:40 -08:00
Matthias Köppe cf52fe9166
Do not set constraint Cython<3; update `libproj`, `pyproj`, `h5py` (#4426)
Since the release of Cython 3 in July 2023, many packages have been updated to
either set an upper bound "Cython < 3", to support both Cython 0.29.x and 3.0, or 
to require Cython 3.

Here we remove the global constraint Cython < 3 added in #4001 and update
individual packages if necessary.
2024-01-27 09:50:34 -08:00
Matthias Köppe cd9cb8d4a2
`tools/dependency-check.sh`: Avoid confusing error message (#4423) 2024-01-25 21:29:27 -08:00
Gyeongjae Choi f2d546dbe3
Bump numpy version to 1.26.1 and use meson backend (#4240)
Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
2023-10-25 12:20:58 +09:00
Gyeongjae Choi fb9417ffe5
BLD Unpin types-setuptools (#4205) 2023-10-08 17:01:02 +09:00
Hood Chatham 9042e6cb1b
ENH Print helpful error if ccache was linked against too new glibc (#4127)
Resolves pyodide#4126.
If someone builds emsdk outside of the docker image and then attempts to use it
inside, there will be an error. This detects it and tells people to clean emsdk.
2023-09-10 21:08:02 -07:00
Hood Chatham ec05ccd762
Cap cython<3 (#4001)
I added tools/constraints.txt and set it into the PIP_CONSTRAINT environment variable.
2023-07-18 23:47:05 -07:00
Juniper Tyree 0980b51677
Implement PEP 658: .whl.metadata files (#3981) 2023-07-17 21:17:24 +09:00
Hood Chatham 983f83ba1d
Remove assemble_wat (#3952)
This is dead code.
2023-06-23 16:09:43 -07:00
Loïc Estève 1c27915653
Build scikit-image 0.21 with meson (#3874) 2023-06-23 17:28:44 +02:00
Gyeongjae Choi d9c29e7083
Avoid compressing archives twice (#3802) 2023-05-02 10:49:05 +09:00
Gyeongjae Choi 25ba93485a
Deploy top-of-tree xbuildenv and pyodide-core to S3 (#3766) 2023-04-17 14:22:07 +09:00
Christian Clauss 4a0ca4ed48
Create tools/docker_image_tag.py (#3758)
[skip ci]
2023-04-14 08:51:30 +02:00
Roman Yurchak 49caa889da
Fix content compression in the deployment script (#3716) 2023-03-30 20:48:19 +02:00
Roman Yurchak 7f4f66b34b
Deploy py-compiled build (#3701)
Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
2023-03-29 22:54:46 +02:00
Christian Clauss 57f36ac6f8
Ruff is now compatible with Python pattern matching (#3650) 2023-03-13 22:45:06 +01:00
Gyeongjae Choi 52c033af9f
CI Add MacOS build (#3602) 2023-03-08 21:22:59 +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
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
Hood Chatham 8c5ae6ff9e
Update description of github releases in docs (#3498) 2023-01-24 13:11:31 -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
Hood Chatham 7422ab370d
Implement more detailed streams support (#3268)
Resolves https://github.com/pyodide/pyodide/issues/3112
This adds a carefully designed API for controlling stdin, stdout, and stderr. It changes
the default behavior to be a bit more useful, though in doing so introduces some mild
backwards incompatibility. In particular:

1. By default, stdin reads directly from `process.stdin` in node (as before) and raises an
error if in browser (not as before).
2. By default, stdout writes directly to `process.stdout` in node (before it called console.log)
and calls console.log in browser (as before).
3. By default, stderr writes directly to `process.stderr` in node (before it called console.warn)
and calls console.warn in browser (as before).
4. In all three cases, by default isatty(stdin/stdout/stderr) is true in node and false in browser
(in the browser it used to be true).
5. As before, if you pass `stdin`, `stdout`, or `stderr` as arguments to `loadPyodide`, `isatty` of
the corresponding stream is set to false.

The stdin function is now more flexible: we now correctly handle the case where it returns an
ArrayBuffer or ArrayBufferView.

I also added 3 new functions to set streams after Pyodide is loaded which offer additional
control:
* `setStdin({stdin?, error?, isatty = false})` -- Sets the stdin function. The stdin function takes no
arguments and should return null, undefined, a string, or a buffer. Sets and `isatty(stdin)` to 
`isatty` (by default `false`). If error is true, set stdin to always raise an EIO error when it is read.
* `setStdout({raw?, batched?, isatty = false})` -- If neither raw nor batched is passed, restore 
default stdout behavior. If rwa is passed, the raw stdout function receives a byte which it should
interpret as a utf8 character code. Sets `isatty(stdout)` to isatty (by default `false`). If batched is
passed but not raw, it sets a batched stdout function. The stdout function receives a string and
should do something with it. In this case it ignores isatty and sets isatty(stdout) to false.
* `setStderr({raw?, batched?, isatty = false})` -- same but with stderr.
2022-12-18 15:55:52 -08:00
Gyeongjae Choi d802fb3fdc
Remove pre-built docker image support (#3342) 2022-12-13 12:04:15 +09:00
Roman Yurchak d48a4f2193
Remove "Python initialization complete" log line (#3247) 2022-12-12 18:54:47 -08: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
Hood Chatham 65694d24dc
Performance tune command line runner reads from stdin (#3243)
The way the command line runner used to read from stdin was pretty inefficient.
This makes it better.
2022-11-12 22:53:45 -08:00
Hood Chatham 8523da0f36
Add a tool to allow us to embed wasm modules with hand coded wat (#3230)
This allows us to embed extra wasm modules into the output. This is split off of #3210.
We need this for #3210 since
1. We don't want to assume that externref is supported but we need to use it as part of
the JS Promise integration proposal. To handle this we segment off the externrefs into
separate wasm modules. If externref is not supported, we load most everything
successfully but these small modules fail to load

2. Even supposing that we know that externref is supported, there is no way to write C
code such that the compiled code uses externref. It's possible using the emscripten
assembly format, but that is less well documented and harder to use for our purposes
than wat.

This PR doesn't actually change anything by itself.
2022-11-10 14:22:59 -08:00
Hood Chatham 92a1a5c014
Fix exit in command line runner (#3241)
Don't set error code to 1 if the program calls exit(0)!
2022-11-09 21:37:36 -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 6bfb9ba329
PKG Add geopandas, fiona, and GDAL (#3213) 2022-11-07 13:44:23 +09:00
Gyeongjae Choi 7d3e19b0f6
Correctly specify files to be packed in a npm package (#3168) 2022-10-12 13:54:12 +09:00
Hood Chatham 5f643fffb5
Fix cmdline runner when stdout doesn't have columns/rows attributes (#3156) 2022-09-29 10:41:20 +09: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
Gyeongjae Choi c3a0ddb0c7
Add a version variable for Pyodide JavaScript Package (#3074) 2022-09-13 13:42:05 +09:00
Roman Yurchak f3ba7865b2
Run core tests in Safari (#2578)
Co-authored-by: Gyeongjae Choi <def6488@gmail.com>
2022-09-08 10:43:55 +09:00
Hood Chatham 3e2d7f29a5
Add command line runner main entry script (#3044)
This PR contains the changes from #3039 and #3040 which should be merged first.
The purpose is to add the main command line script from #2976.
2022-09-05 09:15:13 -07:00
Roman Yurchak c85e00806b
MAINT Switch to pytest-pyodide (#2893)
Co-authored-by: ryanking13 <def6488@gmail.com>
2022-07-31 19:00:45 +09:00
Gyeongjae Choi 84b103a810
Include README when deploying npm package (#2883) 2022-07-27 09:28:33 +09:00