[docs] Update Python API docs (#18662)
* Adds a configuration for Read the Docs
* Removes now longer existing content
* Pins requirements to run Sphinx with Python 3.12
diff --git a/docs/api_docs/python/.readthedocs.yaml b/docs/api_docs/python/.readthedocs.yaml
new file mode 100644
index 0000000..5856d55
--- /dev/null
+++ b/docs/api_docs/python/.readthedocs.yaml
@@ -0,0 +1,13 @@
+version: "2"
+
+build:
+ os: "ubuntu-24.04"
+ tools:
+ python: "3.12"
+
+python:
+ install:
+ - requirements: docs/api_docs/python/requirements.txt
+
+sphinx:
+ configuration: docs/api_docs/python/conf.py
diff --git a/docs/api_docs/python/README.md b/docs/api_docs/python/README.md
index 1dd0567..7ef279f 100644
--- a/docs/api_docs/python/README.md
+++ b/docs/api_docs/python/README.md
@@ -2,7 +2,7 @@
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 website.
+to [Read the Docs](https://readthedocs.org/projects/iree-python-api/).
## Building Docs
diff --git a/docs/api_docs/python/compiler/api.rst b/docs/api_docs/python/compiler/api.rst
index be961a1..4b3f220 100644
--- a/docs/api_docs/python/compiler/api.rst
+++ b/docs/api_docs/python/compiler/api.rst
@@ -4,9 +4,6 @@
IREE provides access to its MLIR-based compiler via a dedicated set of APIs
presented here.
-.. automodule:: iree.compiler.api.driver
+.. automodule:: iree.compiler.api
:imported-members:
- :members: build_iree_vm_pass_pipeline, translate_module_to_vm_bytecode
-
-.. autoclass:: iree.compiler.api.driver.CompilerOptions
:members:
diff --git a/docs/api_docs/python/compiler/index.rst b/docs/api_docs/python/compiler/index.rst
index adcba00..9b6c19f 100644
--- a/docs/api_docs/python/compiler/index.rst
+++ b/docs/api_docs/python/compiler/index.rst
@@ -7,8 +7,6 @@
api.rst
tools.rst
- iree_dialect.rst
- iree_pydm_dialect.rst
+ iree_input_dialect.rst
mlir_dialects.rst
- tensorflow_dialects.rst
mlir.rst
diff --git a/docs/api_docs/python/compiler/iree_dialect.rst b/docs/api_docs/python/compiler/iree_input_dialect.rst
similarity index 70%
rename from docs/api_docs/python/compiler/iree_dialect.rst
rename to docs/api_docs/python/compiler/iree_input_dialect.rst
index ae2329c..96810db 100644
--- a/docs/api_docs/python/compiler/iree_dialect.rst
+++ b/docs/api_docs/python/compiler/iree_input_dialect.rst
@@ -1,10 +1,10 @@
-IREE Dialect
-============
+IREE Input Dialect
+==================
This dialect contains frontend-oriented ops and types which are intended to be
used as input to IREE's compiler (in addition to various MLIR core dialects).
-.. automodule:: iree.compiler.dialects.iree
+.. automodule:: iree.compiler.dialects.iree_input
:imported-members:
:members:
:undoc-members:
diff --git a/docs/api_docs/python/compiler/iree_pydm_dialect.rst b/docs/api_docs/python/compiler/iree_pydm_dialect.rst
deleted file mode 100644
index 726f383..0000000
--- a/docs/api_docs/python/compiler/iree_pydm_dialect.rst
+++ /dev/null
@@ -1,21 +0,0 @@
-IREE Python DataModel Dialect
-=============================
-
-This dialect defines a data model for representing a Python program, suitable
-for compilation to IREE and for the construction of Python-based DSLs.
-
-Importer
---------
-
-.. automodule:: iree.compiler.dialects.iree_pydm.importer
- :imported-members:
- :members:
- :undoc-members:
-
-Operations and Types
---------------------
-
-.. automodule:: iree.compiler.dialects.iree_pydm
- :imported-members:
- :members:
- :undoc-members:
diff --git a/docs/api_docs/python/compiler/mlir_dialects.rst b/docs/api_docs/python/compiler/mlir_dialects.rst
index 4cf44be..58481af 100644
--- a/docs/api_docs/python/compiler/mlir_dialects.rst
+++ b/docs/api_docs/python/compiler/mlir_dialects.rst
@@ -45,15 +45,6 @@
:undoc-members:
-`std` dialect
-----------------
-
-.. automodule:: iree.compiler.dialects.std
- :imported-members:
- :members:
- :undoc-members:
-
-
`tensor` dialect
----------------
diff --git a/docs/api_docs/python/compiler/tensorflow_dialects.rst b/docs/api_docs/python/compiler/tensorflow_dialects.rst
deleted file mode 100644
index 0325dae..0000000
--- a/docs/api_docs/python/compiler/tensorflow_dialects.rst
+++ /dev/null
@@ -1,23 +0,0 @@
-TensorFlow Dialects
-===================
-
-IREE's compiler is capable of ingesting selected TensorFlow dialects directly.
-Those that are integrated into the in-process compiler API are presented here.
-
-
-`chlo` dialect
---------------
-
-.. automodule:: iree.compiler.dialects.chlo
- :imported-members:
- :members:
- :undoc-members:
-
-
-`mhlo` dialect
---------------
-
-.. automodule:: iree.compiler.dialects.mhlo
- :imported-members:
- :members:
- :undoc-members:
diff --git a/docs/api_docs/python/requirements.txt b/docs/api_docs/python/requirements.txt
index c9cf218..642cd5e 100644
--- a/docs/api_docs/python/requirements.txt
+++ b/docs/api_docs/python/requirements.txt
@@ -2,8 +2,13 @@
myst-parser==0.15.2 # For markdown
sphinx_rtd_theme==1.0.0
commonmark==0.9.1
-enum_tools==0.6.4
-sphinx_toolbox==2.15.0
+enum_tools==0.10.0
+sphinx_toolbox==2.16.1
+sphinxcontrib-applehelp==1.0.4
+sphinxcontrib-devhelp==1.0.2
+sphinxcontrib-htmlhelp==2.0.1
+sphinxcontrib-serializinghtml==1.1.5
+sphinxcontrib-qthelp==1.0.3
# IREE Python API
-f https://iree.dev/pip-release-links.html