Repository navigation
feat: include Python 3.15 in EndKeep compatibility matrix #4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Amulet-LevelDB Python 3.15 compatibility Wheels | |
| on: | |
| push: | |
| branches: [feat/python315-compat] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| name: Amulet cp315 / ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 55 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - { os: ubuntu-24.04, wheel: cp315-manylinux_x86_64 } | |
| - { os: windows-2025, wheel: cp315-win_amd64 } | |
| defaults: | |
| run: | |
| shell: bash | |
| steps: | |
| - name: Checkout EndKeep tests | |
| uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false | |
| - name: Checkout exact upstream Amulet 3.0.7a0 | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: Amulet-Team/Amulet-LevelDB | |
| ref: 736228e375e9f535b6522bd28168fc306a5354b9 | |
| path: amulet-src | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Apply Python metadata backport and isolated smoke test | |
| run: | | |
| python - <<'PY' | |
| from pathlib import Path | |
| path = Path("amulet-src/pyproject.toml") | |
| source = path.read_text(encoding="utf-8") | |
| old = 'requires-python = ">=3.14"' | |
| assert source.count(old) == 1 | |
| path.write_text(source.replace(old, 'requires-python = ">=3.12"'), encoding="utf-8") | |
| PY | |
| cp .github/scripts/amulet_leveldb_smoke.py amulet-src/tests/test_backport_smoke.py | |
| git -C amulet-src diff --check | |
| - name: Set up host Python 3.14 for cibuildwheel | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.14" | |
| - name: Install cibuildwheel | |
| run: python -m pip install 'cibuildwheel==4.2.0' | |
| - name: Build and test cp315 Wheel | |
| env: | |
| CIBW_BEFORE_BUILD: 'python -m pip install "cmake>=4.1,<5"' | |
| CIBW_BEFORE_TEST: 'python -m pip install "cmake>=4.1,<5"' | |
| CIBW_TEST_COMMAND: 'python {project}/tests/test_backport_smoke.py && python {project}/tests/test_db.py' | |
| CIBW_TEST_SOURCES: tests | |
| run: | | |
| mkdir -p amulet-dist | |
| cd amulet-src | |
| python -m cibuildwheel --only '${{ matrix.wheel }}' --output-dir ../amulet-dist . | |
| - name: Upload cp315 Wheel | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: amulet-cp315-${{ matrix.os }} | |
| path: amulet-dist/*.whl | |
| if-no-files-found: error | |
| retention-days: 14 | |
| verify: | |
| name: Verify cp315 Wheel provenance | |
| needs: build | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Download cp315 Wheels | |
| uses: actions/download-artifact@v4 | |
| with: | |
| pattern: amulet-cp315-* | |
| path: dist | |
| merge-multiple: true | |
| - name: Validate Wheel metadata and calculate SHA256 | |
| run: | | |
| python - <<'PY' | |
| from hashlib import sha256 | |
| from pathlib import Path | |
| from zipfile import ZipFile | |
| root = Path("dist") | |
| wheels = sorted(root.glob("*.whl")) | |
| assert len(wheels) == 2, [p.name for p in wheels] | |
| for platform in ("manylinux_", "win_amd64"): | |
| matches = [p for p in wheels if "-cp315-cp315-" in p.name and platform in p.name] | |
| assert len(matches) == 1, (platform, [p.name for p in wheels]) | |
| for wheel in wheels: | |
| with ZipFile(wheel) as archive: | |
| metadata_file = next(f for f in archive.namelist() if f.endswith(".dist-info/METADATA")) | |
| metadata = archive.read(metadata_file).decode("utf-8") | |
| assert "Name: amulet-leveldb" in metadata | |
| assert "Version: 3.0.7a0+0.g736228e.dirty" in metadata | |
| assert "Requires-Python: >=3.12" in metadata | |
| assert any(p.endswith(".dist-info/licenses/LICENSE") for p in archive.namelist()) | |
| (root / "SHA256SUMS").write_text( | |
| "".join(f"{sha256(wheel.read_bytes()).hexdigest()} {wheel.name}\n" for wheel in wheels), | |
| encoding="utf-8", | |
| ) | |
| print((root / "SHA256SUMS").read_text()) | |
| PY | |
| - name: Upload verified cp315 Wheels | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: amulet-cp315-verified | |
| path: | | |
| dist/*.whl | |
| dist/SHA256SUMS | |
| if-no-files-found: error | |
| publish: | |
| name: Publish pinned cp315 compatibility dependencies | |
| needs: verify | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/feat/python315-compat' | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Download verified assets | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: amulet-cp315-verified | |
| path: dist | |
| - name: Publish dedicated prerelease, never overwrite existing assets | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| TAG=amulet-leveldb-3.0.7a0-compat-cp315 | |
| if gh release view "$TAG" --repo "$GITHUB_REPOSITORY" >/dev/null 2>&1; then | |
| echo "::error::Compatibility release $TAG already exists; refusing to overwrite it." | |
| exit 1 | |
| fi | |
| gh release create "$TAG" --repo "$GITHUB_REPOSITORY" --target "$GITHUB_SHA" --title "Amulet-LevelDB 3.0.7a0 CPython 3.15 compatibility Wheels" --prerelease --notes "Unofficial CPython 3.15 compatibility builds from Amulet-Team/Amulet-LevelDB commit 736228e375e9f535b6522bd28168fc306a5354b9. The Python metadata floor is relaxed; the native implementation is unchanged. Both Linux and Windows x86-64 Wheels passed upstream DB and EndKeep smoke tests. Upstream Amulet Team License applies." dist/*.whl dist/SHA256SUMS |