[python] Flesh out more of the python parameters API. (#16957)
The existing Python parameters API was sufficient to construct parameter
indexes/archives but did not fully support introspecting them from
Python.
New APIs:
* `FileHandle`:
* Implements buffer protocol for accessing host allocations.
* `is_host_allocation -> bool` property
* `host_allocation -> memoryview`
* `__repr__`
* `ParameterIndexEntry`:
* Class added.
* Properties: `key`, `length`, `metadata`, `is_file`, `is_splat`,
`file_storage`, `file_view`, `splat_pattern`, `__repr__`
* `ParameterIndex`:
* `__getitem__` for index based iteration
* `items()` for `dict`-like access to a list of key/value tuples
* `__repr__`
Includes a version upgrade of nanobind to 1.9.2 as some new features
were needed (just bumped to current vs finding the exact version). This
requires a patch to the Linux CI to make it set up a venv and install
versions of build requirements like all of the others do (vs leaving
this to whatever was packaged in the base docker).
diff --git a/build_tools/cmake/build_and_test_byo_llvm.sh b/build_tools/cmake/build_and_test_byo_llvm.sh
index 2b96c16..043bc98 100755
--- a/build_tools/cmake/build_and_test_byo_llvm.sh
+++ b/build_tools/cmake/build_and_test_byo_llvm.sh
@@ -16,6 +16,15 @@
export IREE_BYOLLVM_BUILD_DIR="${1:-build-byo-llvm}"
export IREE_BYOLLVM_INSTALL_DIR="${IREE_BYOLLVM_BUILD_DIR}/install"
+python3 --version
+
+# We've been instructed to set up a venv.
+VENV_DIR="$IREE_BYOLLVM_BUILD_DIR/.venv"
+echo "Setting up venv at $VENV_DIR"
+python3 -m venv "$VENV_DIR"
+source "$VENV_DIR/bin/activate"
+python -m pip install -r runtime/bindings/python/iree/runtime/build_requirements.txt
+
# Note: by using the `build_llvm` action here, we are exercising byo_llvm.sh's
# ability to build LLVM... from our own third_party/llvm-project. That's not
# the most intuitive interpretation of "bring your own LLVM", since as far as