Skip to content

Conversation

@anthrotype
Copy link
Member

@anthrotype anthrotype commented Jan 2, 2026

Fixes #270

- Detect Emscripten cross-compilation in setup.py, skipping
  platform-specific sources (CoreText, DirectWrite, Uniscribe)
- Add build-pyodide job to CI workflow
- Upload Pyodide wheel to GitHub releases only (PyPI doesn't
  accept wasm32 wheels yet, see pypi/warehouse#10416)

Fixes #270
@anthrotype anthrotype changed the title Pyodide Pyodide support Jan 2, 2026
define_macros.append(("HAVE_DIRECTWRITE", "1"))
define_macros.append(("HAVE_UNISCRIBE", "1"))
libraries += ["usp10", "gdi32", "user32", "rpcrt4", "dwrite"]
sources += [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think harfbuzz.cc has all these files automatically included.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but harfbuzz.cc lacks the subset module..

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. That's annoying.

Pyodide doesn't support Python 3.14 yet, so we need to use 3.13
explicitly instead of '3.x' which resolves to the latest.
Remove redundant test step - cibuildwheel already runs tests via
test-command for each wheel it builds.
@anthrotype
Copy link
Member Author

anthrotype commented Jan 5, 2026

@Vipitis the CI finally built some pyodide wheels for uharfbuzz here: https://github.com/harfbuzz/uharfbuzz/actions/runs/20712353445/artifacts/5023130791

Would you like to give them a go? The uharfuzz own tests do pass when run inside a pyodide venv, like cibuildwheel does.

@Vipitis
Copy link

Vipitis commented Jan 5, 2026

hey @anthrotype thanks a lot for figuring this out.

I obtained the wheel yesterday already from your branch and now also from the ci artifacts. The latter has the wrong version number (0.1) which could be a problem for others.
Both wheels work, but I can't test much functionality at the moment since I found additional hurdles apart from uharfbuzz that I will need to look into before our examples run in the browser.

@anthrotype
Copy link
Member Author

thanks for checking. the version number is expected, only when we push a tagged commit to do an actual release we do a full clone and "unshallow" the repository so the correnct version string is obtained from git. The 0.1 is setuptools-scm failing to get a proper tag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pyodide compatibility?

4 participants