Configuration Reference#
pyodide-build reads configuration from multiple sources. This page documents all available settings.
Precedence#
Configuration is resolved in this order (highest priority first):
Environment variables
pyproject.tomlunder[tool.pyodide.build]Cross-build environment defaults
Built-in defaults
pyproject.toml#
Add configuration under [tool.pyodide.build]:
[tool.pyodide.build]
cflags = "-O2"
cxxflags = "-O2"
ldflags = "-s SIDE_MODULE=1 -O2"
xbuildenv_path = "/path/to/xbuildenv"
User-overridable settings#
These keys can be set in pyproject.toml under [tool.pyodide.build] or via environment variables:
pyproject.toml key |
Env variable |
Description |
|---|---|---|
|
|
C compiler flags |
|
|
C++ compiler flags |
|
|
Linker flags |
|
|
Rust compiler flags |
|
|
Required Rust nightly toolchain |
|
|
URL for the Rust Emscripten target |
|
|
Path to the Meson cross file |
|
|
Path to the cross-build environment |
|
|
Space-separated PEP 508 build requirements to ignore |
|
|
Skip Emscripten version compatibility check ( |
|
|
PyPI index URL for host-side build dependencies |
|
|
URL override for the cross-build environment archive |
|
|
Use the legacy |
Run pyodide config list to see all available variables and their current values.
Environment variables#
Querying configuration#
Use pyodide config to inspect active values:
# List all settings
pyodide config list
# Get a specific value
pyodide config get cflags
pyodide config get meson_cross_file
pyodide config get rust_toolchain
See the CLI Reference for details.