diff --git a/.github/workflows/test_build_release.yml b/.github/workflows/test_build_release.yml index aea5a16a..9b02c31b 100644 --- a/.github/workflows/test_build_release.yml +++ b/.github/workflows/test_build_release.yml @@ -35,7 +35,7 @@ jobs: uses: actions/checkout@v3 - name: Build Release Wheels - run: ./build_tools/build_release.py --core-version 2.3.0 + run: ./build_tools/build_release.py --package-version 2.5.0.dev - name: Validate Release Build if: ${{ !cancelled() }} diff --git a/build_tools/build_release.py b/build_tools/build_release.py index 5a90a7cf..fac65f82 100755 --- a/build_tools/build_release.py +++ b/build_tools/build_release.py @@ -30,19 +30,27 @@ # a specific wheel". IREE_PLATFORM_ARGS = [ # Linux aarch64 - ["--platform", "manylinux_2_28_aarch64", "--python-version", "3.9"], + # ["--platform", "manylinux_2_28_aarch64", "--python-version", "3.9"], ["--platform", "manylinux_2_28_aarch64", "--python-version", "3.10"], ["--platform", "manylinux_2_28_aarch64", "--python-version", "3.11"], ["--platform", "manylinux_2_28_aarch64", "--python-version", "3.12"], + ["--platform", "manylinux_2_28_aarch64", "--python-version", "3.13"], + # ["--platform", "manylinux_2_28_aarch64", "--python-version", "3.13t"], # Linux x86_64 - ["--platform", "manylinux_2_28_x86_64", "--python-version", "3.9"], + # ["--platform", "manylinux_2_28_x86_64", "--python-version", "3.9"], ["--platform", "manylinux_2_28_x86_64", "--python-version", "3.10"], ["--platform", "manylinux_2_28_x86_64", "--python-version", "3.11"], ["--platform", "manylinux_2_28_x86_64", "--python-version", "3.12"], + ["--platform", "manylinux_2_28_x86_64", "--python-version", "3.13"], + # ["--platform", "manylinux_2_28_x86_64", "--python-version", "3.13t"], # MacOS ["--platform", "macosx_13_0_universal2", "--python-version", "3.11"], + ["--platform", "macosx_13_0_universal2", "--python-version", "3.12"], + ["--platform", "macosx_13_0_universal2", "--python-version", "3.13"], # Windows ["--platform", "win_amd64", "--python-version", "3.11"], + ["--platform", "win_amd64", "--python-version", "3.12"], + ["--platform", "win_amd64", "--python-version", "3.13"], ] @@ -55,13 +63,13 @@ def write_version_info(args): with open(VERSION_INFO_FILE, "rt") as f: info_dict = json.load(f) - # Compute core-version. - core_version = eval_version(args.core_version) - if args.core_pre_version: - core_version += eval_version(args.core_pre_version) - if args.core_post_version: - core_version += f".{eval_version(args.core_post_version)}" - info_dict["core-version"] = core_version + # Compute package-version. + package_version = eval_version(args.package_version) + if args.package_pre_version: + package_version += eval_version(args.package_pre_version) + if args.package_post_version: + package_version += f".{eval_version(args.package_post_version)}" + info_dict["package-version"] = package_version with open(VERSION_INFO_FILE, "wt") as f: json.dump(info_dict, f) @@ -112,12 +120,16 @@ def download_iree_binaries(): ] args.extend(platform_args) args += [ - "-f", - "https://iree.dev/pip-release-links.html", + # Uncomment to allow nightly releases (if not pinned in the file) + # "-f", + # "https://iree.dev/pip-release-links.html", "-f", WHEEL_DIR, + # Note: could also drop `-ci` here, if coordinating a release + # across projects and new stable versions of the IREE packages + # haven't yet been pushed. "-r", - REPO_ROOT / "iree-requirements.txt", + REPO_ROOT / "iree-requirements-ci.txt", ] exec(args) @@ -130,16 +142,14 @@ def build_wheel(path, env=None): def main(): parser = argparse.ArgumentParser() + parser.add_argument("--package-version", help="Version to use", required=True) parser.add_argument( - "--core-version", help="Version for the core component", required=True - ) - parser.add_argument( - "--core-pre-version", + "--package-pre-version", help="Pre-release version segment or (YYYYMMDD)", default="", ) parser.add_argument( - "--core-post-version", + "--package-post-version", help="Post-release version segment or (YYYYMMDD)", default="", ) diff --git a/docs/releasing.md b/docs/releasing.md new file mode 100644 index 00000000..4798c0b4 --- /dev/null +++ b/docs/releasing.md @@ -0,0 +1,69 @@ +# Releasing iree-turbine + +This project hosts the https://pypi.org/project/iree-turbine/ package, which +depends on the https://pypi.org/project/iree-compiler/ and +https://pypi.org/project/iree-runtime/ packages. Releases can either be +conducted independently, or they can be coordinated across projects by +initiating a release here. + +## Building Artifacts + +Build a pre-release: + +```bash +./build_tools/build_release.py --package-version 2.5.0 --package-pre-version=rcYYYYMMDD +``` + +Build an official release: + +```bash +./build_tools/build_release.py --package-version 2.5.0 +``` + +This will download all deps, including wheels for all supported platforms and +Python versions for iree-compiler and iree-runtime. All wheels will be placed +in the `wheelhouse/` directory. + +## Testing + +```bash +./build_tools/post_build_release_test.sh +``` + +This will + +1. Set up a python virtual environment using your default `python` version +2. Install wheels from the `wheelhouse/` directory +3. Run `pytest` tests + +## Push + +From the testing venv, verify that everything is sane: + +```bash +pip freeze +``` + +Push IREE deps (if needed/updated): + +```bash +twine upload wheelhouse/iree_compiler-* wheelhouse/iree_runtime-* +``` + +Push built wheels: + +```bash +twine upload wheelhouse/iree_turbine-* +``` + +## Install from PyPI and Sanity Check + +TODO: Script this + +From the testing venv: + +```bash +pip uninstall -y iree-turbine iree-compiler iree-runtime +pip install iree-turbine +pytest . +``` diff --git a/setup.py b/setup.py index c73c3532..efeda21c 100644 --- a/setup.py +++ b/setup.py @@ -33,7 +33,7 @@ def load_version_info(): version_info = load_version_info() -PACKAGE_VERSION = version_info["core-version"] +PACKAGE_VERSION = version_info["package-version"] packages = find_namespace_packages( include=[ diff --git a/version_info.json b/version_info.json index 98788f98..cd6bf775 100644 --- a/version_info.json +++ b/version_info.json @@ -1 +1,3 @@ -{"core-version": "2.3.0rc20240621", "package-version": "0.9.7.dev1"} +{ + "package-version": "2.5.0" +}