Documentation for the Python API is built with Sphinx under this directory. When new versions are released, the documentation is generated and published to the Read the Docs project and is served at readthedocs.io.
python -m venv .venv source .venv/bin/activate python -m pip install -r requirements.txt
You can build the site using either released Python packages or local packages, whichever appear first on the PYTHONPATH
environment variable. The requirements.txt
file used in the previous step downloads the latest pre-release (nightly) iree-base-compiler
and iree-base-runtime
packages.
To use local packages, such as when changing docstrings and wanting to see how they appear in the generated documentation, follow the instructions for building the Python bindings from source at https://iree.dev/building-from-source/getting-started/#using-the-python-bindings.
In particular, after building with -DIREE_BUILD_PYTHON_BINDINGS=ON
, you will need to extend your PYTHONPATH
to include the relevant build directories. The the generated .env
files can help with this:
source ../../../iree-build/.env && export PYTHONPATH
sphinx-build -b html . _build
sphinx-autobuild . _build
Then open http://127.0.0.1:8000 as instructed by the logs and make changes to the files in this directory as needed to update the documentation.
A clean rebuild will show all warnings again:
make clean sphinx-build -b html . _build