diff --git a/.github/workflows/publish_python_dotpromptz_package.yml b/.github/workflows/publish_python_dotpromptz_package.yml index 15cec55e0..c3123522f 100644 --- a/.github/workflows/publish_python_dotpromptz_package.yml +++ b/.github/workflows/publish_python_dotpromptz_package.yml @@ -34,8 +34,7 @@ on: default: 'https://test.pypi.org/legacy/' permissions: - contents: write - id-token: write + contents: read jobs: check_and_build: @@ -46,61 +45,78 @@ jobs: if: github.event_name == 'workflow_dispatch' || (github.event_name == 'release' && startsWith(github.event.release.tag_name, 'dotpromptz-') && !startsWith(github.event.release.tag_name, 'dotpromptz-handlebars-')) permissions: contents: write - actions: write - strategy: - matrix: - python-version: - - "3.12" - - fail-fast: false + outputs: + version: ${{ steps.version.outputs.version }} steps: - - uses: actions/checkout@v6 - - - name: Set up Python - uses: actions/setup-python@v6 + - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 with: - python-version: ${{ matrix.python-version }} - - # Dependency Check of handlebars - - name: Install Dependencies for Check - run: pip install requests + ref: ${{ inputs.tag_name || github.event.release.tag_name }} + persist-credentials: false - - name: Smoke Test - Check handlebarrz Dependency on PyPI - id: check_dependency + - name: Read version from tag + id: version + env: + TAG: ${{ inputs.tag_name || github.event.release.tag_name }} run: | - IS_FOUND=$(python -c ' - import requests - url = "https://pypi.org/project/dotpromptz-handlebars/json" - response = requests.get(url) - - if response.status_code == 200: - print("true") - else: - print("false") - ') - - echo "Dependency 'handlebarrz' checked. Status: $IS_FOUND" - - if [ "$IS_FOUND" = "true" ]; then - echo "BUILD_SUCCESS=true" >> "$GITHUB_OUTPUT" - else - echo "BUILD_SUCCESS=false" >> "$GITHUB_OUTPUT" - fi - - - name: Dependency Check Failed - Exit - if: steps.check_dependency.outputs.BUILD_SUCCESS == 'false' + case "$TAG" in + dotpromptz-*) ;; + *) echo "::error::Tag '$TAG' is not a dotpromptz release tag."; exit 1 ;; + esac + echo "version=${TAG#dotpromptz-}" >> "$GITHUB_OUTPUT" + + - name: Set up Python + uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 + with: + python-version: "3.12" + + # Preflight floor check: Replaces the legacy unpinned handlebarrz existence check. + # + # dotpromptz depends on dotpromptz-handlebars>=X.Y.Z (configured in pyproject.toml). + # Because PyPI releases are immutable and downstream pip installs resolve + # dependencies immediately, publishing dotpromptz before its required floor version + # is live on PyPI leaves dotpromptz in a broken, uninstallable state. + # + # Rather than checking unversioned package existence with `requests`, this step: + # 1. Dynamically reads the dependency floor from pyproject.toml via stdlib `tomllib`. + # 2. Queries PyPI's per-version JSON endpoint via stdlib `urllib` to ensure the exact + # minimum required release is available before building or uploading. + - name: Check dotpromptz-handlebars floor is on PyPI run: | - echo "::error::Dependency 'handlebarrz' not found on PyPI. Aborting publish." - exit 1 + python - <<'EOF' + import re + import sys + import tomllib + import urllib.error + import urllib.request + + # 1. Extract the minimum required version of dotpromptz-handlebars + with open('python/dotpromptz/pyproject.toml', 'rb') as f: + deps = tomllib.load(f)['project']['dependencies'] + spec = next((d for d in deps if d.startswith('dotpromptz-handlebars')), None) + m = re.fullmatch(r'dotpromptz-handlebars\s*>=\s*([0-9][0-9A-Za-z.]*)', spec or '') + if not m: + print(f'::error::Expected dotpromptz-handlebars>=X.Y.Z, got {spec!r}.') + sys.exit(1) + floor = m.group(1) + + # 2. Verify that this exact floor version exists and is live on PyPI + url = f'https://pypi.org/pypi/dotpromptz-handlebars/{floor}/json' + try: + urllib.request.urlopen(url, timeout=30) + except urllib.error.HTTPError as e: + print(f'::error::dotpromptz-handlebars {floor} not on PyPI ({e.code}). Release it first.') + sys.exit(1) + print(f'dotpromptz-handlebars {floor} is on PyPI.') + EOF - # BUILD dotpromptz (Only if handlebarrz check passed) + # BUILD dotpromptz (only if the dependency check passed) - name: Set up uv and Create VENV - uses: astral-sh/setup-uv@v7 + uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5.4.2 with: activate-environment: true - python-version: ${{ matrix.python-version }} - enable-cache: true + python-version: "3.12" + enable-cache: false - name: Install Build Tools run: | @@ -114,7 +130,7 @@ jobs: twine check dist/* - name: Upload dotpromptz Distributions for Python - uses: actions/upload-artifact@v6 + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 with: name: dist-dotpromptz path: python/dotpromptz/dist/ @@ -127,17 +143,16 @@ jobs: name: pypi_github_publishing permissions: id-token: write - env: - PYPI_REPOSITORY_URL: ${{ inputs.repository_url || 'https://upload.pypi.org/legacy/' }} steps: - name: Checkout code at tag - uses: actions/checkout@v6 + uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 with: ref: ${{ github.event.inputs.tag_name || github.event.release.tag_name }} + persist-credentials: false - name: Download artifacts - uses: actions/download-artifact@v7 + uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 with: name: dist-dotpromptz path: dist/ @@ -147,13 +162,14 @@ jobs: with: verbose: true packages-dir: dist/ - repository-url: ${{ inputs.repository_url }} + repository-url: ${{ github.event_name == 'release' && 'https://upload.pypi.org/legacy/' || inputs.repository_url || 'https://upload.pypi.org/legacy/' }} smoke_test_pypi_package: - name: Verify Package Usability - needs: [pypi_publish] + name: Verify Package Usability on Python ${{ matrix.python-version }} + needs: [check_and_build, pypi_publish] runs-on: ubuntu-latest strategy: + fail-fast: false matrix: python-version: - "3.10" @@ -162,32 +178,41 @@ jobs: - "3.13" - "3.14" steps: - - uses: actions/checkout@v6 - - name: Set up Python - uses: actions/setup-python@v6 + uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 with: python-version: ${{ matrix.python-version }} - name: Install dotpromptz from PyPI + env: + VERSION: ${{ needs.check_and_build.outputs.version }} + INDEX_URL: ${{ (github.event_name != 'release' && inputs.repository_url == 'https://test.pypi.org/legacy/') && 'https://test.pypi.org/simple/' || 'https://pypi.org/simple/' }} run: | - pip install dotpromptz + # A new upload can take a few minutes to reach the index. + for attempt in $(seq 1 20); do + if python -m pip install --no-cache-dir --index-url "$INDEX_URL" "dotpromptz==${VERSION}"; then + exit 0 + fi + echo "dotpromptz ${VERSION} not installable yet (attempt ${attempt}/20)" + sleep 30 + done + echo "::error::dotpromptz ${VERSION} never became installable from ${INDEX_URL}" + exit 1 - - name: Run Smoke Test Script + - name: Import and render run: | - python -c " - import importlib.metadata - import sys - + python - <<'PY' + import asyncio + from dotpromptz import Dotprompt try: - importlib.metadata.version('dotpromptz') - print('Smoke test successful: Package found and imported.') - - except importlib.metadata.PackageNotFoundError: - print('Smoke test FAILED: Package not found in environment.') - sys.exit(1) - - except Exception as e: - print(f'Smoke test FAILED due to unexpected error: {e}') - sys.exit(1) - " + from dotpromptz import DataArgument + except ImportError: + from dotpromptz.typing import DataArgument + + res = asyncio.run( + Dotprompt().render('Hi {{name}}', DataArgument(input={'name': 'Ada'})) + ) + text = res.messages[0].content[0].text + assert text == 'Hi Ada', res + print(text) + PY diff --git a/.github/workflows/publish_python_handlebarrz_package.yml b/.github/workflows/publish_python_handlebarrz_package.yml index 3e9f88a28..461a1f9f6 100644 --- a/.github/workflows/publish_python_handlebarrz_package.yml +++ b/.github/workflows/publish_python_handlebarrz_package.yml @@ -14,6 +14,15 @@ # # SPDX-License-Identifier: Apache-2.0 +# Publishes python/handlebars as dotpromptz-handlebars. The package is pure +# Python, so one py3-none-any wheel and one sdist cover every platform. +# +# NOTE: Do NOT rename this workflow file yet. +# PyPI Trusted Publishing (OIDC) is registered on PyPI against this exact workflow +# path (.github/workflows/publish_python_handlebarrz_package.yml) and the +# pypi_github_publishing environment. Renaming this file before updating the +# Trusted Publisher configuration on PyPI will cause OIDC token minting to fail (403). + name: Publish dotpromptz-handlebars Package to PyPI permissions: @@ -25,7 +34,7 @@ on: workflow_dispatch: inputs: tag_name: - description: "The exact release tag of handlebarrz to publish" + description: "The exact release tag to publish, e.g. dotpromptz-handlebars-0.2.0" required: true type: string repository_url: @@ -35,631 +44,72 @@ on: - 'https://upload.pypi.org/legacy/' - 'https://test.pypi.org/legacy/' default: 'https://test.pypi.org/legacy/' - # ------------------------------------------------------------------------- - # Platform override inputs for workflow_dispatch (one-off builds) - # These override the env defaults below when manually triggering the workflow - # ------------------------------------------------------------------------- - enable_linux_arm64: - description: 'Enable Linux ARM64 (Ubuntu) builds' - type: boolean - default: true - enable_linux_x86_64: - description: 'Enable Linux x86_64 (Ubuntu) builds' - type: boolean - default: true - enable_alpine_arm64: - description: 'Enable Alpine ARM64 (musl) builds' - type: boolean - default: true - enable_alpine_x86_64: - description: 'Enable Alpine x86_64 (musl) builds' - type: boolean - default: true - enable_macos_arm64: - description: 'Enable macOS ARM64 (Apple Silicon) builds' - type: boolean - default: true - enable_macos_x86_64: - description: 'Enable macOS x86_64 (Intel) builds' - type: boolean - default: true - enable_windows_x86_64: - description: 'Enable Windows x86_64 builds (may have wheel corruption issues)' - type: boolean - default: false -# pull_request: -# branches: [ main ] - -# ============================================================================== -# PLATFORM SUPPORT FLAGS -# ============================================================================== -# Toggle platform builds by changing the default values in the setup job below. -# For one-off builds with different settings, use workflow_dispatch inputs. -# -# Current status: -# - Linux ARM64: ENABLED (native ubuntu-24.04-arm runner) -# - Linux x86_64: ENABLED (native ubuntu-latest runner) -# - Alpine ARM64: ENABLED (musl cross-compile on ARM64 runner) -# - Alpine x86_64: ENABLED (musl cross-compile on x86_64 runner) -# - macOS ARM64: ENABLED (native macos-14 Apple Silicon runner) -# - macOS x86_64: ENABLED (cross-compile on macos-14) -# - Windows x86_64: DISABLED (wheel corruption issue - see TODO below) -# -# TODO(handlebarrz): Re-enable Windows support once wheel corruption issue is fixed. -# Issue: PyPI upload fails with "400 Invalid distribution file. ZIP archive not -# accepted: Mis-matched data size" for Windows wheels. -# ============================================================================== jobs: - # =========================================================================== - # SETUP JOB - Determines which platforms to build - # =========================================================================== - # This job outputs platform flags that other jobs reference. - # To enable/disable a platform permanently, change the default value below. - # For one-off changes, use workflow_dispatch inputs. - - setup: - name: Setup platform flags + build: + name: Build wheel and sdist runs-on: ubuntu-latest - # Only run for handlebarrz releases or workflow_dispatch if: github.event_name == 'workflow_dispatch' || (github.event_name == 'release' && startsWith(github.event.release.tag_name, 'dotpromptz-handlebars-')) outputs: - # Platform flags - change these defaults to enable/disable platforms - enable_linux_arm64: ${{ steps.flags.outputs.enable_linux_arm64 }} - enable_linux_x86_64: ${{ steps.flags.outputs.enable_linux_x86_64 }} - enable_alpine_arm64: ${{ steps.flags.outputs.enable_alpine_arm64 }} - enable_alpine_x86_64: ${{ steps.flags.outputs.enable_alpine_x86_64 }} - enable_macos_arm64: ${{ steps.flags.outputs.enable_macos_arm64 }} - enable_macos_x86_64: ${{ steps.flags.outputs.enable_macos_x86_64 }} - enable_windows_x86_64: ${{ steps.flags.outputs.enable_windows_x86_64 }} - steps: - - name: Set platform flags - id: flags - run: | - # ===================================================================== - # PLATFORM DEFAULTS - Change these to enable/disable platforms - # ===================================================================== - # For workflow_dispatch, inputs override these defaults. - # For release events, these defaults are used. - - # Linux platforms - DEFAULT_LINUX_ARM64="true" - DEFAULT_LINUX_X86_64="true" - - # Alpine (musl) platforms - DEFAULT_ALPINE_ARM64="true" - DEFAULT_ALPINE_X86_64="true" - - # macOS platforms - DEFAULT_MACOS_ARM64="true" - DEFAULT_MACOS_X86_64="true" - - # Windows platforms (disabled due to wheel corruption issue) - DEFAULT_WINDOWS_X86_64="false" - - # ===================================================================== - # Output logic - workflow_dispatch inputs override defaults - # ===================================================================== - if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then - echo "enable_linux_arm64=${{ inputs.enable_linux_arm64 }}" >> $GITHUB_OUTPUT - echo "enable_linux_x86_64=${{ inputs.enable_linux_x86_64 }}" >> $GITHUB_OUTPUT - echo "enable_alpine_arm64=${{ inputs.enable_alpine_arm64 }}" >> $GITHUB_OUTPUT - echo "enable_alpine_x86_64=${{ inputs.enable_alpine_x86_64 }}" >> $GITHUB_OUTPUT - echo "enable_macos_arm64=${{ inputs.enable_macos_arm64 }}" >> $GITHUB_OUTPUT - echo "enable_macos_x86_64=${{ inputs.enable_macos_x86_64 }}" >> $GITHUB_OUTPUT - echo "enable_windows_x86_64=${{ inputs.enable_windows_x86_64 }}" >> $GITHUB_OUTPUT - else - echo "enable_linux_arm64=$DEFAULT_LINUX_ARM64" >> $GITHUB_OUTPUT - echo "enable_linux_x86_64=$DEFAULT_LINUX_X86_64" >> $GITHUB_OUTPUT - echo "enable_alpine_arm64=$DEFAULT_ALPINE_ARM64" >> $GITHUB_OUTPUT - echo "enable_alpine_x86_64=$DEFAULT_ALPINE_X86_64" >> $GITHUB_OUTPUT - echo "enable_macos_arm64=$DEFAULT_MACOS_ARM64" >> $GITHUB_OUTPUT - echo "enable_macos_x86_64=$DEFAULT_MACOS_X86_64" >> $GITHUB_OUTPUT - echo "enable_windows_x86_64=$DEFAULT_WINDOWS_X86_64" >> $GITHUB_OUTPUT - fi - - # Log the flags for debugging - echo "Platform flags set:" - cat $GITHUB_OUTPUT - - # =========================================================================== - # BUILD JOBS - # =========================================================================== - - build_ubuntu_arm64: - name: Build for Ubuntu ARM64 - needs: [setup] - runs-on: ubuntu-24.04-arm # Native ARM64 runner - no QEMU needed - if: needs.setup.outputs.enable_linux_arm64 == 'true' - env: - SCCACHE_GHA_ENABLED: "true" - RUSTC_WRAPPER: "sccache" - strategy: - matrix: - python_version: - - "3.10" - - "3.11" - - "3.12" - - "3.13" - - "3.14" - steps: - - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 - with: - persist-credentials: false - - - name: Set up Python - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 - with: - python-version: ${{ matrix.python_version }} - - - name: Set up Rust - uses: dtolnay/rust-toolchain@6bed0761d98439e5a578e2877258200ad565ba87 # stable - with: - toolchain: stable - env: - RUSTUP_MAX_RETRIES: 3 - - - name: Setup sccache - uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9 - - - name: Install uv - uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5.4.2 - with: - enable-cache: false - - - name: Install maturin - run: uv pip install --system "maturin[patchelf]" - - - name: Build wheels - working-directory: ./python/handlebarrz - env: - PYO3_USE_ABI3_FORWARD_COMPATIBILITY: 1 - run: | - # Build for multiple manylinux compatibility levels - for i in $(seq 40 -1 24); do - maturin build --release -i python${{ matrix.python_version }} --compatibility manylinux_2_$i --auditwheel=skip -o dist || true - done - maturin build --release -i python${{ matrix.python_version }} -o dist - - - name: Upload build packages - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 - with: - name: wheels-ubuntu-arm64-${{ matrix.python_version }} - path: python/handlebarrz/dist - - build_alpine_arm64: - name: Build for Alpine ARM64 - needs: [setup] - runs-on: ubuntu-24.04-arm # Native ARM64 runner - cross-compile for musl - if: needs.setup.outputs.enable_alpine_arm64 == 'true' - env: - SCCACHE_GHA_ENABLED: "true" - RUSTC_WRAPPER: "sccache" - strategy: - matrix: - python_version: - - "3.10" - - "3.11" - - "3.12" - - "3.13" - - "3.14" - steps: - - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 - with: - persist-credentials: false - - - name: Set up Python - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 - with: - python-version: ${{ matrix.python_version }} - - - name: Set up Rust - uses: dtolnay/rust-toolchain@6bed0761d98439e5a578e2877258200ad565ba87 # stable - with: - toolchain: stable - targets: aarch64-unknown-linux-musl - env: - RUSTUP_MAX_RETRIES: 3 - - - name: Setup sccache - uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9 - - - name: Install musl tools - run: sudo apt-get update && sudo apt-get install -y musl-tools - - - name: Install uv - uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5.4.2 - with: - enable-cache: false - - - name: Install maturin - run: uv pip install --system "maturin[patchelf]" - - - name: Build wheels - working-directory: ./python/handlebarrz - env: - PYO3_USE_ABI3_FORWARD_COMPATIBILITY: 1 - run: | - maturin build --release --target aarch64-unknown-linux-musl -i python${{ matrix.python_version }} -o dist - - - name: Upload build packages - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 - with: - name: wheels-alpine-arm64-${{ matrix.python_version }} - path: python/handlebarrz/dist - - build_alpine_x86_64: - name: Build for Alpine x86_64 - needs: [setup] - runs-on: ubuntu-latest # Native x86_64 runner - cross-compile for musl - if: needs.setup.outputs.enable_alpine_x86_64 == 'true' - env: - SCCACHE_GHA_ENABLED: "true" - RUSTC_WRAPPER: "sccache" - strategy: - matrix: - python_version: - - "3.10" - - "3.11" - - "3.12" - - "3.13" - - "3.14" + version: ${{ steps.version.outputs.version }} steps: - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 with: + ref: ${{ inputs.tag_name || github.event.release.tag_name }} persist-credentials: false - - name: Set up Python - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 - with: - python-version: ${{ matrix.python_version }} - - - name: Set up Rust - uses: dtolnay/rust-toolchain@6bed0761d98439e5a578e2877258200ad565ba87 # stable - with: - toolchain: stable - targets: x86_64-unknown-linux-musl - env: - RUSTUP_MAX_RETRIES: 3 - - - name: Setup sccache - uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9 - - - name: Install musl tools - run: sudo apt-get update && sudo apt-get install -y musl-tools - - - name: Install uv - uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5.4.2 - with: - enable-cache: false - - - name: Install maturin - run: uv pip install --system "maturin[patchelf]" - - - name: Build wheels - working-directory: ./python/handlebarrz + - name: Read version from tag + id: version env: - PYO3_USE_ABI3_FORWARD_COMPATIBILITY: 1 + TAG: ${{ inputs.tag_name || github.event.release.tag_name }} run: | - maturin build --release --target x86_64-unknown-linux-musl -i python${{ matrix.python_version }} -o dist - - - name: Upload build packages - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 - with: - name: wheels-alpine-x86_64-${{ matrix.python_version }} - path: python/handlebarrz/dist - - build_ubuntu_x86_64: - name: Build for Ubuntu x86_64 - needs: [setup] - runs-on: ubuntu-latest # Native x86_64 runner - if: needs.setup.outputs.enable_linux_x86_64 == 'true' - env: - SCCACHE_GHA_ENABLED: "true" - RUSTC_WRAPPER: "sccache" - strategy: - matrix: - python_version: - - "3.10" - - "3.11" - - "3.12" - - "3.13" - - "3.14" - - steps: - - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 - with: - persist-credentials: false - - - name: Set up Python - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 - with: - python-version: ${{ matrix.python_version }} - - - name: Set up Rust - uses: dtolnay/rust-toolchain@6bed0761d98439e5a578e2877258200ad565ba87 # stable - with: - toolchain: stable - env: - RUSTUP_MAX_RETRIES: 3 - - - name: Setup sccache - uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9 + case "$TAG" in + dotpromptz-handlebars-*) ;; + *) echo "::error::Tag '$TAG' is not a dotpromptz-handlebars release tag."; exit 1 ;; + esac + echo "version=${TAG#dotpromptz-handlebars-}" >> "$GITHUB_OUTPUT" - name: Install uv uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5.4.2 - with: - enable-cache: false - - name: Install maturin - run: uv pip install --system "maturin[patchelf]" + - name: Build + working-directory: python + run: uv build --package dotpromptz-handlebars --out-dir dist - - name: Build wheels - working-directory: ./python/handlebarrz + - name: Check the build matches the tag + working-directory: python env: - PYO3_USE_ABI3_FORWARD_COMPATIBILITY: 1 + VERSION: ${{ steps.version.outputs.version }} run: | - # Build for multiple manylinux compatibility levels - for i in $(seq 40 -1 24); do - maturin build --release -i python${{ matrix.python_version }} --compatibility manylinux_2_$i --auditwheel=skip -o dist || true - done - maturin build --release -i python${{ matrix.python_version }} -o dist - - - name: Upload build packages - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 - with: - name: wheels-ubuntu-x86-64-${{ matrix.python_version }} - path: python/handlebarrz/dist - - build_windows_x86_64: - name: Build for Windows x86_64 - needs: [setup] - runs-on: windows-latest - # Currently disabled due to wheel corruption issues - see setup job defaults - if: needs.setup.outputs.enable_windows_x86_64 == 'true' - env: - SCCACHE_GHA_ENABLED: "true" - RUSTC_WRAPPER: "sccache" - strategy: - matrix: - python_version: - - "3.10" - - "3.11" - - "3.12" - - "3.13" - - "3.14" - steps: - - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 - with: - persist-credentials: false - - - name: Set up Python - id: setup_py - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 - with: - python-version: ${{ matrix.python_version }} - - - name: Set up Rust - uses: dtolnay/rust-toolchain@6bed0761d98439e5a578e2877258200ad565ba87 # stable - with: - toolchain: stable - env: - RUSTUP_MAX_RETRIES: 3 - - - name: Setup sccache - uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9 - - - name: Install maturin - run: pip install maturin - - - name: Build wheel - working-directory: ./python/handlebarrz - run: maturin build --release --strip -o dist -i $env:STEPS_SETUP_PY_OUTPUTS_PYTHON_PATH - env: - STEPS_SETUP_PY_OUTPUTS_PYTHON_PATH: ${{ steps.setup_py.outputs.python-path }} - - - name: Upload build packages + ls -l dist + test -f "dist/dotpromptz_handlebars-${VERSION}-py3-none-any.whl" \ + || { echo "::error::Expected dotpromptz_handlebars-${VERSION}-py3-none-any.whl"; exit 1; } + test -f "dist/dotpromptz_handlebars-${VERSION}.tar.gz" \ + || { echo "::error::Expected dotpromptz_handlebars-${VERSION}.tar.gz"; exit 1; } + test "$(ls dist | wc -l)" -eq 2 \ + || { echo "::error::Expected exactly one wheel and one sdist"; exit 1; } + + - name: Upload distributions uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 with: - name: wheels-windows-x86_64-${{ matrix.python_version }} - path: python/handlebarrz/dist - - build_macos_arm64: - name: Build for macOS ARM64 - needs: [setup] - runs-on: macos-14 # Apple Silicon - if: needs.setup.outputs.enable_macos_arm64 == 'true' - env: - SCCACHE_GHA_ENABLED: "true" - RUSTC_WRAPPER: "sccache" - strategy: - matrix: - python_version: - - "3.10" - - "3.11" - - "3.12" - - "3.13" - - "3.14" - steps: - - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 - with: - persist-credentials: false - - - name: Set up Node.js for Actions - uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 - with: - node-version: '20' - - - name: Set up Python - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 - with: - python-version: ${{ matrix.python_version }} - - - name: Set up Rust - uses: dtolnay/rust-toolchain@6bed0761d98439e5a578e2877258200ad565ba87 # stable - with: - toolchain: stable - env: - RUSTUP_MAX_RETRIES: 3 - - - name: Setup sccache - uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9 - - - name: Install maturin - run: pip install maturin - - - name: Clean Cargo Target Directory - run: rm -rf target/ - working-directory: ./python/handlebarrz - - - name: Build wheel - working-directory: ./python/handlebarrz - run: maturin build --release --strip -o dist - - - name: Upload build packages - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 - with: - name: wheels-macos-arm64-${{ matrix.python_version }}-${{ github.job }} - path: python/handlebarrz/dist - - build_macos_x86_64: - name: Build for macOS x86_64 - needs: [setup] - runs-on: macos-14 - if: needs.setup.outputs.enable_macos_x86_64 == 'true' - env: - SCCACHE_GHA_ENABLED: "true" - RUSTC_WRAPPER: "sccache" - strategy: - matrix: - python_version: - - "3.10" - - "3.11" - - "3.12" - - "3.13" - - "3.14" - steps: - - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 - with: - persist-credentials: false - - - name: Set up Python - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 - with: - python-version: ${{ matrix.python_version }} - - - name: Set up Rust - uses: dtolnay/rust-toolchain@6bed0761d98439e5a578e2877258200ad565ba87 # stable - with: - toolchain: stable - target: x86_64-apple-darwin - env: - RUSTUP_MAX_RETRIES: 3 - - - name: Setup sccache - uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9 - - - name: Install maturin - run: pip install maturin - - - name: Build wheel - working-directory: ./python/handlebarrz - run: maturin build --release --strip -o dist --target x86_64-apple-darwin - - - name: Upload build packages - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 - with: - name: wheels-macos-x86_64-${{ matrix.python_version }}-${{ github.job }} - path: python/handlebarrz/dist - -# build_windows_arm64: -# name: Build for Windows ARM64 -# runs-on: windows-latest -# env: -# PYO3_NO_PYTHON: '1' -# strategy: -# matrix: -# python_version: -# - "3.10" -# - "3.11" -# - "3.12" -# - "3.13" -# - "3.14" -# steps: -# - uses: actions/checkout@v6 -# -# - name: Set up Python -# id: setup_py -# uses: actions/setup-python@v6 -# with: -# python-version: ${{ matrix.python_version }} -# -# - name: Set up Rust -# uses: dtolnay/rust-toolchain@stable -# with: -# toolchain: stable -# target: aarch64-pc-windows-msvc -# -# - name: Install maturin -# run: pip install maturin -# -# - name: Patch Cargo.toml for Windows ARM64 (Bump abi3 to 3.11) -# working-directory: ./python/handlebarrz -# run: | -# (Get-Content Cargo.toml) -replace 'abi3-py310', 'abi3-py311' | Set-Content Cargo.toml -# -# - name: Build wheel -# working-directory: ./python/handlebarrz -# run: maturin build --release --strip -o dist --target aarch64-pc-windows-msvc -# -# - name: Upload build packages -# uses: actions/upload-artifact@v6 -# with: -# name: wheels-windows-arm64-${{ matrix.python_version }} -# path: python/handlebarrz/dist - - # =========================================================================== - # PUBLISH JOB - # =========================================================================== + name: dist-dotpromptz-handlebars + path: python/dist/ pypi_publish: - name: Upload to PyPI by python version - # NOTE: Build jobs with conditional 'if' may be skipped. We use always() to run - # this job regardless, and check that at least one build succeeded or was skipped - # (skipped jobs don't produce artifacts but don't block the workflow). - needs: [setup, build_ubuntu_arm64, build_ubuntu_x86_64, build_alpine_arm64, build_alpine_x86_64, build_macos_arm64, build_macos_x86_64, build_windows_x86_64] - if: | - always() && !cancelled() && needs.setup.result == 'success' && - (needs.build_ubuntu_arm64.result == 'success' || needs.build_ubuntu_arm64.result == 'skipped' || - needs.build_ubuntu_x86_64.result == 'success' || needs.build_ubuntu_x86_64.result == 'skipped' || - needs.build_alpine_arm64.result == 'success' || needs.build_alpine_arm64.result == 'skipped' || - needs.build_alpine_x86_64.result == 'success' || needs.build_alpine_x86_64.result == 'skipped' || - needs.build_macos_arm64.result == 'success' || needs.build_macos_arm64.result == 'skipped' || - needs.build_macos_x86_64.result == 'success' || needs.build_macos_x86_64.result == 'skipped' || - needs.build_windows_x86_64.result == 'success' || needs.build_windows_x86_64.result == 'skipped') + name: Upload to PyPI + needs: [build] runs-on: ubuntu-latest environment: name: pypi_github_publishing permissions: id-token: write steps: - # abi3 wheels from every Python version share one filename per platform. - # Keep a single build so that file is written once. - - name: Download wheels + - name: Download distributions uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 with: - pattern: '*-3.10*' - merge-multiple: true + name: dist-dotpromptz-handlebars path: dist/ - - name: Delete unsupported wheels - run: | - FILES=$(find dist/ -type f -name "*linux_aarch64*") - if [[ -n "$FILES" ]]; then - echo "removing local wheel" - rm -f $FILES - fi - - name: Publish distribution to PyPI uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # release/v1.13 with: @@ -667,258 +117,41 @@ jobs: packages-dir: dist/ repository-url: ${{ github.event_name == 'release' && 'https://upload.pypi.org/legacy/' || inputs.repository_url || 'https://upload.pypi.org/legacy/' }} - - name: Sleep for pypi server to load - run: sleep 180 - - # =========================================================================== - # SMOKE TEST JOBS - # =========================================================================== - - smoke_test_linux_arm64: - name: Test for Linux ARM64 - needs: [setup, pypi_publish] - runs-on: ubuntu-24.04-arm # Native ARM64 runner - no QEMU needed - if: needs.setup.outputs.enable_linux_arm64 == 'true' - strategy: - matrix: - python_version: - - "3.10" - - "3.11" - - "3.12" - - "3.13" - - "3.14" - linux_platform: - - "debian" - - "fedora" - steps: - - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 - with: - persist-credentials: false - - - name: Build container - run: | - cd python/handlebarrz/smoke_tests - docker build \ - -t test-${{ matrix.linux_platform }}-arm64 \ - -f Dockerfile-${{ matrix.linux_platform }}-arm64 . - - - name: Run container - run: | - docker run test-${{ matrix.linux_platform }}-arm64:latest sh ./execute-test.sh "${{ matrix.python_version }}" - continue-on-error: true - - smoke_test_alpine_arm64: - name: Test for Alpine ARM64 - needs: [setup, pypi_publish] - runs-on: ubuntu-24.04-arm # Native ARM64 runner - no QEMU needed - if: needs.setup.outputs.enable_alpine_arm64 == 'true' - strategy: - matrix: - python_version: - - "3.10" - - "3.11" - - "3.12" - - "3.13" - - "3.14" - steps: - - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 - with: - persist-credentials: false - - - name: Build container - run: | - cd python/handlebarrz/smoke_tests - docker build \ - -t test-alpine \ - -f Dockerfile-alpine . - - - name: Run container - run: | - docker run test-alpine:latest sh ./execute-test.sh "${{ matrix.python_version }}" - continue-on-error: true - - smoke_test_alpine_x86_64: - name: Test for Alpine x86_64 - needs: [setup, pypi_publish] - runs-on: ubuntu-latest # Native x86_64 - no QEMU needed - if: needs.setup.outputs.enable_alpine_x86_64 == 'true' - strategy: - matrix: - python_version: - - "3.10" - - "3.11" - - "3.12" - - "3.13" - - "3.14" - steps: - - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 - with: - persist-credentials: false - - - name: Build container - run: | - cd python/handlebarrz/smoke_tests - docker build \ - -t test-alpine-x86-64 \ - -f Dockerfile-alpine-x86-64 . - - - name: Run container - run: | - docker run test-alpine-x86-64:latest sh ./execute-test.sh "${{ matrix.python_version }}" - continue-on-error: true - - smoke_test_linux_x86_64: - name: Test for Linux x86_64 - needs: [setup, pypi_publish] + smoke_test: + name: Install from the index on Python ${{ matrix.python_version }} + needs: [build, pypi_publish] runs-on: ubuntu-latest - if: needs.setup.outputs.enable_linux_x86_64 == 'true' strategy: + fail-fast: false matrix: - python_version: - - "3.10" - - "3.11" - - "3.12" - - "3.13" - - "3.14" - linux_platform: - - "debian" - - "fedora" + python_version: ["3.10", "3.11", "3.12", "3.13", "3.14"] steps: - - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 + - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 with: - persist-credentials: false + python-version: ${{ matrix.python_version }} - - name: Build container + - name: Install the published version + env: + VERSION: ${{ needs.build.outputs.version }} + INDEX_URL: ${{ (github.event_name != 'release' && inputs.repository_url == 'https://test.pypi.org/legacy/') && 'https://test.pypi.org/simple/' || 'https://pypi.org/simple/' }} run: | - cd python/handlebarrz/smoke_tests - docker build \ - -t test-${{ matrix.linux_platform }} \ - -f Dockerfile-${{ matrix.linux_platform }} . + # A new upload can take a few minutes to reach the index. + for attempt in $(seq 1 20); do + if python -m pip install --no-cache-dir --index-url "$INDEX_URL" "dotpromptz-handlebars==${VERSION}"; then + exit 0 + fi + echo "dotpromptz-handlebars ${VERSION} not installable yet (attempt ${attempt}/20)" + sleep 30 + done + echo "::error::dotpromptz-handlebars ${VERSION} never became installable from ${INDEX_URL}" + exit 1 - - name: Run container + - name: Import and render run: | - docker run test-${{ matrix.linux_platform }}:latest sh ./execute-test.sh "${{ matrix.python_version }}" - continue-on-error: true - + python - <<'PY' + from dotpromptz_handlebars import Handlebars - smoke_test_macos_arm64: - name: Test for macOS ARM64 - needs: [setup, pypi_publish] - runs-on: macos-14 - if: needs.setup.outputs.enable_macos_arm64 == 'true' - strategy: - matrix: - python_version: - - "3.10" - - "3.11" - - "3.12" - - "3.13" - - "3.14" - steps: - - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 - with: - persist-credentials: false - - - name: Set up Python - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 - with: - python-version: ${{ matrix.python_version }} - - - name: Install package from PyPI - run: pip install dotpromptz-handlebars - - - name: Run smoke test - working-directory: ./python/handlebarrz/smoke_tests - run: python -c "import handlebarrz; print('Import successful')" - - smoke_test_macos_x86_64: - name: Test for macOS x86_64 - needs: [setup, pypi_publish] - runs-on: macos-14 - if: needs.setup.outputs.enable_macos_x86_64 == 'true' - strategy: - matrix: - python_version: - - "3.10" - - "3.11" - - "3.12" - - "3.13" - - "3.14" - steps: - - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 - with: - persist-credentials: false - - - name: Set up Python - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 - with: - python-version: ${{ matrix.python_version }} - architecture: x64 - - - name: Install package from PyPI - run: pip install dotpromptz-handlebars - - - name: Run smoke test - working-directory: ./python/handlebarrz/smoke_tests - run: python -c "import handlebarrz; print('Import successful')" - continue-on-error: true - - smoke_test_windows_x86_64: - name: Test for Windows x86_64 - needs: [setup, pypi_publish] - runs-on: windows-latest - # Currently disabled due to wheel corruption issues - see setup job defaults - if: needs.setup.outputs.enable_windows_x86_64 == 'true' - strategy: - matrix: - python_version: - - "3.10" - - "3.11" - - "3.12" - - "3.13" - - "3.14" - steps: - - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 - with: - persist-credentials: false - - - name: Set up Python - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 - with: - python-version: ${{ matrix.python_version }} - - - name: Install package from PyPI - run: pip install dotpromptz-handlebars - - - name: Run smoke test - working-directory: ./python/handlebarrz/smoke_tests - run: python -c "import handlebarrz; print('Import successful')" - continue-on-error: true - -# smoke_test_windows_arm64: -# name: Test for Windows ARM64 -# needs: [ pypi_publish ] -# runs-on: windows-latest -# strategy: -# matrix: -# python_version: -# - "3.10" -# - "3.11" -# - "3.12" -# - "3.13" -# - "3.14" -# steps: -# - uses: actions/checkout@v6 -# -# - name: Set up Python -# uses: actions/setup-python@v6 -# with: -# python-version: ${{ matrix.python_version }} -# -# - name: Install package from PyPI -# run: pip install dotpromptz-handlebars -# -# - name: Run smoke test -# working-directory: ./python/handlebarrz/smoke_tests -# run: python -c "import handlebarrz; print('Import successful')" -# continue-on-error: true + out = Handlebars().compile('Hello {{name}}!')({'name': 'World'}) + assert out == 'Hello World!', out + print(out) + PY diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 74c4b3175..53e5f7c3a 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -23,21 +23,23 @@ on: workflow_dispatch: permissions: - contents: write - pull-requests: write + contents: read jobs: release-please: runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write outputs: releases_created: ${{ steps.release.outputs.releases_created }} prs_created: ${{ steps.release.outputs.prs_created }} prs: ${{ steps.release.outputs.prs }} dotpromptz_release_created: ${{ steps.release.outputs['dotpromptz--release_created'] }} - handlebarrz_release_created: ${{ steps.release.outputs['dotpromptz-handlebars--release_created'] }} + handlebars_release_created: ${{ steps.release.outputs['dotpromptz-handlebars--release_created'] }} pr: ${{ steps.release.outputs.pr }} steps: - - uses: googleapis/release-please-action@v4 + - uses: googleapis/release-please-action@5c625bfb5d1ff62eadeeb3772007f7f66fdcf071 # v4 id: release with: token: ${{ secrets.RELEASE_PLEASE_TOKEN }} @@ -53,6 +55,8 @@ jobs: update-lockfiles: runs-on: ubuntu-latest + permissions: + contents: write needs: release-please # Only run if release-please created/updated PRs if: needs.release-please.outputs.prs != '' && needs.release-please.outputs.prs != '[]' @@ -62,13 +66,13 @@ jobs: pr: ${{ fromJson(needs.release-please.outputs.prs) }} steps: - name: Checkout PR branch - uses: actions/checkout@v6 + uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 with: ref: ${{ matrix.pr.headBranchName }} token: ${{ secrets.RELEASE_PLEASE_TOKEN }} - name: Setup Bazel - uses: bazel-contrib/setup-bazel@0.18.0 + uses: bazel-contrib/setup-bazel@083175551ceeceebc757ebee2127fde78840ca77 # 0.18.0 with: bazelisk-cache: true disk-cache: ${{ github.workflow }}-lockfiles @@ -76,25 +80,25 @@ jobs: cache-save: true - name: Install uv - uses: astral-sh/setup-uv@v5 + uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5.4.2 with: version: "latest" - name: Setup Go - uses: actions/setup-go@v6 + uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6 with: go-version: "1.24.x" - name: Setup Node.js - uses: actions/setup-node@v6 + uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6 with: node-version: 20 - name: Install pnpm - uses: pnpm/action-setup@v4 + uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4 - name: Setup Rust - uses: dtolnay/rust-toolchain@stable + uses: dtolnay/rust-toolchain@89b12181fb390509a0842a86cc55eeb8eb928c1d # master env: RUSTUP_MAX_RETRIES: 3 @@ -106,11 +110,6 @@ jobs: run: | cargo update --workspace || echo "Root Cargo.lock update skipped" - - name: Update Cargo.lock (handlebarrz) - working-directory: python/handlebarrz - run: | - cargo update || echo "handlebarrz Cargo.lock update skipped" - - name: Update Go lockfile run: | go mod tidy -C go || echo "Go mod tidy skipped" diff --git a/.github/workflows/smoke-test-wheels.yml b/.github/workflows/smoke-test-wheels.yml deleted file mode 100644 index dcaa02bd8..000000000 --- a/.github/workflows/smoke-test-wheels.yml +++ /dev/null @@ -1,241 +0,0 @@ -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# SPDX-License-Identifier: Apache-2.0 - -name: Test Rust-Python Package - -on: - workflow_dispatch: - - -jobs: - smoke_test_linux_arm64: - name: Test for Linux ARM64 - runs-on: ubuntu-24.04-arm # Native ARM64 runner - no QEMU needed - strategy: - matrix: - python_version: - - "3.10" - - "3.11" - - "3.12" - - "3.13" - - "3.14" - linux_platform: - - "debian" - - "fedora" - steps: - - uses: actions/checkout@v6 - - - name: Build container - run: | - cd python/handlebarrz/smoke_tests - docker build \ - -t test-${{ matrix.linux_platform }}-arm64 \ - -f Dockerfile-${{ matrix.linux_platform }}-arm64 . - - - name: Run container - run: | - docker run test-${{ matrix.linux_platform }}-arm64:latest sh ./execute-test.sh "${{ matrix.python_version }}" - continue-on-error: true - - smoke_test_alpine_arm64: - name: Test for Alpine ARM64 - runs-on: ubuntu-24.04-arm # Native ARM64 runner - no QEMU needed - strategy: - matrix: - python_version: - - "3.10" - - "3.11" - - "3.12" - - "3.13" - - "3.14" - steps: - - uses: actions/checkout@v6 - - - name: Build container - run: | - cd python/handlebarrz/smoke_tests - docker build \ - -t test-alpine-arm64 \ - -f Dockerfile-alpine . - - - name: Run container - run: | - docker run test-alpine-arm64:latest sh ./execute-test.sh "${{ matrix.python_version }}" - continue-on-error: true - - smoke_test_alpine_x86_64: - name: Test for Alpine x86_64 - runs-on: ubuntu-latest # Native x86_64 - no QEMU needed - strategy: - matrix: - python_version: - - "3.10" - - "3.11" - - "3.12" - - "3.13" - - "3.14" - steps: - - uses: actions/checkout@v6 - - - name: Build container - run: | - cd python/handlebarrz/smoke_tests - docker build \ - -t test-alpine-x86-64 \ - -f Dockerfile-alpine-x86-64 . - - - name: Run container - run: | - docker run test-alpine-x86-64:latest sh ./execute-test.sh "${{ matrix.python_version }}" - continue-on-error: true - - smoke_test_linux_x86_64: - name: Test for Linux x86_64 - runs-on: ubuntu-latest # Native x86_64 - strategy: - matrix: - python_version: - - "3.10" - - "3.11" - - "3.12" - - "3.13" - - "3.14" - linux_platform: - - "debian" - - "fedora" - steps: - - uses: actions/checkout@v6 - - - name: Build container - run: | - cd python/handlebarrz/smoke_tests - docker build \ - -t test-${{ matrix.linux_platform }} \ - -f Dockerfile-${{ matrix.linux_platform }} . - - - name: Run container - run: | - docker run test-${{ matrix.linux_platform }}:latest sh ./execute-test.sh "${{ matrix.python_version }}" - continue-on-error: true - - - smoke_test_macos_arm64: - name: Test for macOS ARM64 - runs-on: macos-14 - strategy: - matrix: - python_version: - - "3.10" - - "3.11" - - "3.12" - - "3.13" - - "3.14" - steps: - - uses: actions/checkout@v6 - - - name: Set up Python - uses: actions/setup-python@v6 - with: - python-version: ${{ matrix.python_version }} - - - name: Install package from PyPI - run: pip install dotpromptz-handlebars - - - name: Run smoke test - working-directory: ./python/handlebarrz/smoke_tests - run: python -c "import handlebarrz; print('Import successful')" - - smoke_test_macos_x86_64: - name: Test for macOS x86_64 - runs-on: macos-14 - strategy: - matrix: - python_version: - - "3.10" - - "3.11" - - "3.12" - - "3.13" - - "3.14" - steps: - - uses: actions/checkout@v6 - - - name: Set up Python - uses: actions/setup-python@v6 - with: - python-version: ${{ matrix.python_version }} - architecture: x64 - - - name: Install package from PyPI - run: pip install dotpromptz-handlebars - - - name: Run smoke test - working-directory: ./python/handlebarrz/smoke_tests - run: python -c "import handlebarrz; print('Import successful')" - continue-on-error: true - - smoke_test_windows_x86_64: - name: Test for Windows x86_64 - runs-on: windows-latest - strategy: - matrix: - python_version: - - "3.10" - - "3.11" - - "3.12" - - "3.13" - - "3.14" - steps: - - uses: actions/checkout@v6 - - - name: Set up Python - uses: actions/setup-python@v6 - with: - python-version: ${{ matrix.python_version }} - - - name: Install package from PyPI - run: pip install dotpromptz-handlebars - - - name: Run smoke test - working-directory: ./python/handlebarrz/smoke_tests - run: python -c "import handlebarrz; print('Import successful')" - continue-on-error: true - - smoke_test_windows_arm64: - name: Test for Windows ARM64 - runs-on: windows-latest - strategy: - matrix: - python_version: - - "3.10" - - "3.11" - - "3.12" - - "3.13" - - "3.14" - steps: - - uses: actions/checkout@v6 - - - name: Set up Python - uses: actions/setup-python@v6 - with: - python-version: ${{ matrix.python_version }} - - - name: Install package from PyPI - run: pip install dotpromptz-handlebars - - - name: Run smoke test - working-directory: ./python/handlebarrz/smoke_tests - run: python -c "import handlebarrz; print('Import successful')" - continue-on-error: true diff --git a/.release-please-config.json b/.release-please-config.json index c55a96ad2..dd0aee86d 100644 --- a/.release-please-config.json +++ b/.release-please-config.json @@ -32,25 +32,16 @@ } ] }, - "python/handlebarrz": { + "python/handlebars": { "release-type": "python", "package-name": "dotpromptz-handlebars", "component": "dotpromptz-handlebars", + "release-as": "0.2.0", "extra-files": [ { "type": "toml", "path": "pyproject.toml", "jsonpath": "$.project.version" - }, - { - "type": "toml", - "path": "Cargo.toml", - "jsonpath": "$.package.version" - }, - { - "type": "toml", - "path": "smoke_tests/pyproject.toml", - "jsonpath": "$.project.version" } ] }, diff --git a/.release-please-manifest.json b/.release-please-manifest.json index ddb6484de..1926c0120 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,7 +1,7 @@ { "js": "0.2.9", "python/dotpromptz": "0.1.6", - "python/handlebarrz": "0.1.9", + "python/handlebars": "0.1.9", "go": "0.2.1", "java": "0.1.0", "dart/dotprompt": "0.0.1",