diff --git a/.github/workflows/build-streams.yaml b/.github/workflows/build-streams.yaml index 9d7de60e..f3731709 100644 --- a/.github/workflows/build-streams.yaml +++ b/.github/workflows/build-streams.yaml @@ -79,6 +79,15 @@ jobs: working-directory: ./sentry_streams docker-options: -e CMAKE_POLICY_VERSION_MINIMUM=3.5 + + - name: Validate wheels + run: | + ls sentry_streams/dist + python -m venv tmp_venv + . tmp_venv/bin/activate + pip install sentry_streams/dist/*abi3*.whl + python -c 'import sentry_streams; print("✓ sentry_streams imported successfully")' + python -c 'import sentry_streams.rust_streams; print("✓ rust_streams imported successfully")' - name: Upload wheels uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 with: @@ -102,11 +111,43 @@ jobs: name: wheels-sdist path: ./sentry_streams/dist + test-wheels: + permissions: read-all + name: Test wheels on multiple Python versions + runs-on: ${{ matrix.platform.runner }} + needs: [macos] + strategy: + matrix: + platform: + - runner: macos-latest + target: x86_64 + - runner: macos-latest + target: aarch64 + python-version: ['3.11', '3.12', '3.13'] + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 + - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 + with: + python-version: ${{ matrix.python-version }} + - name: Download wheels + uses: actions/download-artifact@c0cfd0a45de93f63d5fc8bf01b9a901b6d3b79f8 + with: + name: wheels-macos-${{ matrix.platform.target }} + path: ./dist + - name: Test wheel + run: | + ls ./dist + python -m venv test_venv + . test_venv/bin/activate + pip install ./dist/*abi3*.whl + python -c 'import sentry_streams; print("✓ sentry_streams imported successfully on Python ${{ matrix.python-version }}")' + python -c 'import sentry_streams.rust_streams; print("✓ rust_streams imported successfully on Python ${{ matrix.python-version }}")' + merge: permissions: read-all name: Create Release Artifact runs-on: ubuntu-latest - needs: [linux, macos, sdist] + needs: [linux, macos, sdist, test-wheels] steps: - uses: actions/upload-artifact/merge@ea165f8d65b6e75b540449e92b4886f43607fa02 with: diff --git a/sentry_streams/Cargo.toml b/sentry_streams/Cargo.toml index ed27a32b..63932e45 100644 --- a/sentry_streams/Cargo.toml +++ b/sentry_streams/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" edition = "2021" [dependencies] -pyo3 = { version = "0.24.0"} +pyo3 = { version = "0.24.0", features = ["abi3", "abi3-py311"] } serde = { version = "1.0", features = ["derive"] } sentry_arroyo = "2.19.5" chrono = "0.4.40"