tree: 5064c72dfbee62dbdbbb813860f2f294d3d44e83 [search]
  1. iree/
  2. test/
  3. BUILD.bazel
  4. check_requirements.py
  5. CMakeLists.txt
  6. pyproject.toml
  7. README.md
  8. requirements.txt
  9. setup.py
  10. version.json
core/python/README.md

IREE Core Python Package

iree.core holds the pure-Python components shared by the IREE compiler (iree-base-compiler) and runtime (iree-base-runtime) packages. It is distributed as the iree-base-core wheel.

iree is a namespace package that iree.core shares with iree.compiler and iree.runtime, so there must be no iree/__init__.py.

Dependencies

pyproject.toml lists the dependencies of the wheel as version ranges. requirements.txt pins them with hashes for builds and CI. To regenerate it after a change, run the command at its top in this directory.

Testing

With Bazel:

bazel test //core/python/...

With CMake, the tests are registered if the Python interpreter of the build has the dependencies installed. They are run by pytest. The Python bindings are not needed:

python -m pip install pytest
python -m pip install --require-hashes -r core/python/requirements.txt
ctest --test-dir ${BUILD_DIR} -R iree/core/python

Against the installed package:

python -m pip install pytest core/python/
python -m pytest core/python/test