mirror of https://github.com/pyodide/pyodide.git
DOC Adds a cibuildwheel GH example to out-of-tree build docs (#5062)
This commit is contained in:
parent
0004a8fd00
commit
933e2755f2
|
@ -15,7 +15,9 @@ Subsystem for Linux.
|
||||||
If your package is a pure Python package (i.e., if the wheel ends in
|
If your package is a pure Python package (i.e., if the wheel ends in
|
||||||
`py3-none-any.whl`) then follow the official PyPA documentation on building
|
`py3-none-any.whl`) then follow the official PyPA documentation on building
|
||||||
[wheels](https://packaging.python.org/en/latest/tutorials/packaging-projects/#generating-distribution-archives)
|
[wheels](https://packaging.python.org/en/latest/tutorials/packaging-projects/#generating-distribution-archives)
|
||||||
Otherwise, the procedure is as follows.
|
For binary packages, the manual steps are detailed below. In addition,
|
||||||
|
[cibuildwheel](https://cibuildwheel.pypa.io/en/stable/) 2.19 or later provides
|
||||||
|
support for building binary wheels with Pyodide as a target.
|
||||||
|
|
||||||
### Install pyodide-build
|
### Install pyodide-build
|
||||||
|
|
||||||
|
@ -142,20 +144,20 @@ and you can pass options to it just like normal. Currently `subprocess` doesn't
|
||||||
work, so if you have a test runner that uses `subprocess` then it cannot be
|
work, so if you have a test runner that uses `subprocess` then it cannot be
|
||||||
used.
|
used.
|
||||||
|
|
||||||
## Build Github actions example
|
## Github Actions build examples
|
||||||
|
|
||||||
Here is a complete example of a Github Actions workflow for building a Python
|
This is a complete example for building a Pyodide wheel out of tree using
|
||||||
wheel out of tree:
|
`pyodide build` directly:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04 # or ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: actions/setup-python@v5
|
- uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: 3.11.2
|
python-version: 3.12
|
||||||
- run: |
|
- run: |
|
||||||
pip install pyodide-build>=0.23.0
|
pip install pyodide-build>=0.28.0
|
||||||
echo EMSCRIPTEN_VERSION=$(pyodide config get emscripten_version) >> $GITHUB_ENV
|
echo EMSCRIPTEN_VERSION=$(pyodide config get emscripten_version) >> $GITHUB_ENV
|
||||||
- uses: mymindstorm/setup-emsdk@v14
|
- uses: mymindstorm/setup-emsdk@v14
|
||||||
with:
|
with:
|
||||||
|
@ -163,6 +165,17 @@ runs-on: ubuntu-22.04
|
||||||
- run: pyodide build
|
- run: pyodide build
|
||||||
```
|
```
|
||||||
|
|
||||||
|
And this is an example using `cibuildwheel` to build a Pyodide wheel out of tree:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
runs-on: ubuntu-22.04 # or ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: pypa/cibuildwheel@v2.20.0
|
||||||
|
env:
|
||||||
|
CIBW_PLATFORM: pyodide
|
||||||
|
```
|
||||||
|
|
||||||
For an example "in the wild" of a github action to build and test a wheel
|
For an example "in the wild" of a github action to build and test a wheel
|
||||||
against Pyodide, see
|
against Pyodide, see
|
||||||
[the numpy CI](https://github.com/numpy/numpy/blob/main/.github/workflows/emscripten.yml)
|
[the numpy CI](https://github.com/numpy/numpy/blob/main/.github/workflows/emscripten.yml)
|
||||||
|
|
Loading…
Reference in New Issue