Modernize and relocate iree/runtime Python package to runtime/bindings/python. (#8912)
* Modernize and relocate iree/runtime Python package to iree/runtime/python.
Non-functional changes:
* Moves `bindings/python/iree/runtime` -> `iree/runtime/python/iree/runtime`.
* Fixes dash vs undescore inconsistency in compile install path. Now both use underscores (python_packages/iree_compiler and python_packages/iree_runtime).
* Moves build directory for iree/compiler/python to iree/compiler/python (was outputting to bindings/python). Updates locations that were hard-coded.
Functional changes:
* Removes the old build-dir only setup.py in favor of an iree/runtime/setup.py that works from either the source or build dir.
* Reworks the releases to use the new setup.py as-is vs scripting the build manually.
* iree.runtime.version is now generated in the same way as iree.compiler.version.
* Users can now run iree/runtime/setup.py with pip themselves to generate a wheel (i.e. `pip wheel iree/runtime`).
It is now possible to integrate python package testing into the presubmit and have build jobs that generated Python installable binaries for subsequent steps.
The only file left in bindings/python is build_requirements.txt. It is referred to by some docs and CI jobs so leaving as-is for the moment (will find it a new home in a followup).
diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt
new file mode 100644
index 0000000..8a3ce7a
--- /dev/null
+++ b/runtime/CMakeLists.txt
@@ -0,0 +1,14 @@
+# Copyright 2022 The IREE Authors
+#
+# Licensed under the Apache License v2.0 with LLVM Exceptions.
+# See https://llvm.org/LICENSE.txt for license information.
+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+
+if(IREE_BUILD_PYTHON_BINDINGS)
+ # Copy Python packaging files to the build dir so that we can install from
+ # there.
+ configure_file(pyproject.toml pyproject.toml COPYONLY)
+ configure_file(setup.py setup.py @ONLY)
+
+ add_subdirectory(bindings/python/iree/runtime)
+endif()