Installation¶
Python¶
Python 3.10 and newer. The extension is built against the stable ABI
(abi3), so one wheel per platform serves every supported Python — upgrading
your interpreter does not mean waiting for a new release.
Free-threaded Python 3.14 (python3.14t) is the exception: it has no stable
ABI yet, so it gets wheels of its own, for Linux on x86_64 and aarch64, macOS
on Apple silicon, and Windows on x64 and ARM64. Importing xsdkit leaves the
GIL disabled, and one SchemaSet can be used from many threads at once. On
other platforms, pip install xsdkit under 3.14t builds from the source
distribution.
The package ships type stubs and a py.typed marker, so mypy and pyright
check calls into it like any other typed library.
Rust¶
The minimum supported Rust version is 1.87, checked in CI on every commit
rather than merely claimed in Cargo.toml.
There are no optional features to choose between for ordinary use. The
python and extension-module features exist to build the Python bindings
and are not something a Rust dependent turns on.
Building the repository¶
git clone https://github.com/mluttikh/xsdkit
cd xsdkit
cargo test # the Rust side
maturin develop --release # build and install the Python extension
pytest python/tests -q # the Python side
maturin develop builds a debug binary unless you pass --release, and
the difference is large enough to mislead you if you are measuring anything.
The conformance suite¶
The W3C XML Schema Test Suite is 231 MB and is not vendored. Point XSDTESTS
at a checkout and the suite runs; leave it unset and those tests skip. Fetch
the commit tests/conformance/SUITE pins, which is the one the baselines were
blessed against — the suite's default branch moves on without them.
scripts/fetch-w3c-suite.sh /tmp/xsdtests
export XSDTESTS=/tmp/xsdtests
cargo test --test w3c_suite -- --nocapture # both halves, ~35 seconds
python3 scripts/check-w3c-python.py # the instance cases, through the installed wheel
Both halves are scored against a committed per-case baseline in
tests/conformance/. After a deliberate change, re-bless it with
XSDKIT_BLESS=1 in the same commit, and read the diff first.
The documentation¶
This site is built with Material for MkDocs, with the Rust API reference mounted underneath it.
pip install -r docs/requirements.txt
./scripts/build-docs.sh # builds rustdoc + the site into site/
mkdocs serve # live preview on http://127.0.0.1:8000
The Python reference is generated from the built extension module, so
maturin develop has to have run first.