Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
7bdeaff
Pyodide: force only one thread
IvanIsCoding May 10, 2025
7ce8078
Add .cargo/config.toml
IvanIsCoding May 11, 2025
b440e6b
Unstable feature that makes rayon work
IvanIsCoding May 11, 2025
e70b263
Newline
IvanIsCoding May 11, 2025
bf15e3b
Merge remote-tracking branch 'upstream/main' into pyodide-rayon
IvanIsCoding May 11, 2025
76f5dff
Document pyodide
IvanIsCoding May 11, 2025
4b17893
Add release note for pyodide
IvanIsCoding May 11, 2025
0e3b0ce
Fix separator
IvanIsCoding May 11, 2025
3527a6f
Consolidate the bare minimum of flags
IvanIsCoding May 12, 2025
72ceb1a
Add emscripten-wasm-eh flag
IvanIsCoding May 12, 2025
65d4eb8
Use pixi to have a reproducible pyodide build
IvanIsCoding May 13, 2025
8c4ed7b
Add GitHub Actions to execute
IvanIsCoding May 13, 2025
d99c029
Fix main.yml syntax
IvanIsCoding May 13, 2025
615d5bd
Specify pyproject.toml
IvanIsCoding May 13, 2025
32e44cf
Actually download repo
IvanIsCoding May 14, 2025
ad1f19d
Add pyodide build docs
IvanIsCoding May 14, 2025
901c674
Minor stuff
IvanIsCoding May 14, 2025
92b8910
Minor update to CONTRIBUTING.md
IvanIsCoding May 14, 2025
826fbe7
Merge branch 'main' into pyodide-rayon
IvanIsCoding May 17, 2025
61383bf
Merge branch 'pyodide-rayon' into pixi-pyodide
IvanIsCoding May 17, 2025
b6fcd9a
Merge branch 'main' into pyodide-rayon
IvanIsCoding May 29, 2025
aa34512
Solve nit
IvanIsCoding May 29, 2025
854e672
Merge branch 'pyodide-rayon' into pixi-pyodide
IvanIsCoding May 29, 2025
1a04b00
Merge branch 'main' into pyodide-rayon
IvanIsCoding May 29, 2025
b0042ff
Merge branch 'pyodide-rayon' into pixi-pyodide
IvanIsCoding May 30, 2025
d7bb215
Bump pyodide to 0.27.6 and pyodide-build to 0.30.4
IvanIsCoding May 30, 2025
5378a9e
Merge branch 'main' into pyodide-rayon
IvanIsCoding Jun 4, 2025
cea6073
Merge remote-tracking branch 'origin/pyodide-rayon' into pixi-pyodide
IvanIsCoding Jun 4, 2025
6b8b8fc
Merge branch 'main' into pixi-pyodide
IvanIsCoding Jun 28, 2025
1a188e4
Merge branch 'main' into pixi-pyodide
IvanIsCoding Jun 29, 2025
24f000c
Update pyodide build & pyodide
IvanIsCoding Jun 29, 2025
ce94f8e
Merge remote-tracking branch 'upstream/main' into pixi-pyodide
IvanIsCoding Aug 12, 2025
281fae3
Merge branch 'main' into pixi-pyodide
IvanIsCoding Sep 29, 2025
74c65db
Merge branch 'main' into pixi-pyodide
IvanIsCoding Sep 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
docs/* linguist-documentation
releasenotes/* linguist-documentation
# SCM syntax highlighting & preventing 3-way merges
pixi.lock merge=binary linguist-language=YAML linguist-generated=true
13 changes: 13 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -199,3 +199,16 @@ jobs:
with:
name: html_docs
path: docs/build/html
pyodide-build:
if: github.repository_owner == 'Qiskit'
needs: [tests]
name: Pyodide Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: prefix-dev/[email protected]
with:
manifest-path: pyproject.toml
pixi-version: v0.46.0
environments: default
- run: pixi run build_pyodide
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,10 @@ rustworkx-core/Cargo.lock
**/.DS_Store
venv/
.python-version

# pixi environments
.pixi
*.egg-info

# pyodide xbuild
.xbuildenv
53 changes: 53 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,59 @@ has the necessary approvals and is tagged as `automerge` unless it has a merge
conflict or has a failed CI run. Doing so will just waste CI resources and
delay everything from merging, including your PR.

### Pyodide Support

`rustworkx` has experimental support for Pyodide, the Python distribution for
the browser.

Because building for Pyodide is a more involved process, we use [Pixi](https://pixi.sh/latest/)
to manage the dependencies of the build. Currently, the scripts work only for Linux x86-64.
It is also possible to run the build on Windows with Windows Subsystem for Linux (WSL). At
the moment, aarch64 platforms like macOS cannot run the script.

Please refer to the [Pixi](https://pixi.sh/latest/) page for the latest instructions on how
to install Pixi. Once installed, there's a single command that needs to be run.

#### Building for Pyodide

At the root of the directory, simply run:

```bash
pixi run build_pyodide
```

This will create a separate environment with all of the required toolchains. At the end,
a Pyodide wheel will be available in the `dist` folder if the build is successful.

#### Testing Pyodide Wheels

Currently, there are no tests for Pyodide wheels. In the future, we plan to add smoke tests
like those in the `pyodide-recipes` repository.

#### Updating `pyodide-build` and dependencies

All the dependencies for the Pyodide build are listed under `[tool.pixi.dependencies]`. To find a set
of versions that works, visit the [pyodide-cross-build-environments.json](https://github.com/pyodide/pyodide/blob/main/pyodide-cross-build-environments.json) file in the `pyodide` repository.

We'll need to align the [Emscripten](https://anaconda.org/conda-forge/emscripten) version from `conda-forge` with one
of the public releases. Then, we pick a `pyodide-build` version higher than the required build version and the equivalent Python
version also specified in the cross build environments. Lastly, update `[tool.pixi.tasks.install_xbuildenv]` to install
the selected version of Pyodide.

Lastly, we need to pin the Rust compiler. To find an appropriate Rust compiler version, run:

```bash
pixi shell
pyodide config list
```

This will output a list including `rust_toolchain`. Currently, `pyodide-build` requires Rust Nightly. Because conda-forge
only provides stable releases, we'll need to map a nightly version to a stable version. Some repositories like [oxalica/rust-overlay]([oxalica/rust-overlay](https://github.com/oxalica/rust-overlay/tree/master/manifests/nightly/)) contain a list of the nightly releases. For example, `nightly-2025-02-01`
maps roughly to `1.86`. If that version was not yet stable, we could try picking `1.85` as well.

After updating the versions in `[tool.pixi.dependencies]`, run `pixi lock` which will update `pixi.lock`. Onwards, all builds
will use the same environment. As long as `pixi run build_pyodide` passes locally or on CI it should keep compiling and building.

### Stable Branch Policy and Backporting

The stable branch is intended to be a safe source of fixes for high-impact bugs,
Expand Down
4 changes: 4 additions & 0 deletions docs/source/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ source.
- WASM (Emscripten)
- :ref:`tier-experimental`
-
* - Pyodide
- WASM (Emscripten)
- :ref:`tier-experimental`
-


.. _manylinux 2014: https://peps.python.org/pep-0599/>
Expand Down
Loading
Loading