Repository navigation
feat: support Python 3.12–3.14 and Windows x64 #12
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: Python and Windows compatibility | |
| on: | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| concurrency: | |
| group: compatibility-${{ github.head_ref || github.ref_name }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| full-matrix: | |
| name: ${{ matrix.os }} / Python ${{ matrix.python }} | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 50 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - { os: ubuntu-24.04, python: '3.12', wheel: cp312-manylinux_x86_64 } | |
| - { os: ubuntu-24.04, python: '3.13', wheel: cp313-manylinux_x86_64 } | |
| - { os: ubuntu-24.04, python: '3.14', wheel: '' } | |
| - { os: windows-2025, python: '3.12', wheel: cp312-win_amd64 } | |
| - { os: windows-2025, python: '3.13', wheel: cp313-win_amd64 } | |
| - { os: windows-2025, python: '3.14', wheel: '' } | |
| defaults: | |
| run: | |
| shell: bash | |
| steps: | |
| - name: Checkout EndKeep | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Checkout upstream Amulet 3.0.7a0 at verified commit | |
| if: matrix.python != '3.14' | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: Amulet-Team/Amulet-LevelDB | |
| ref: 736228e375e9f535b6522bd28168fc306a5354b9 | |
| path: amulet-src | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Patch Amulet Python floor | |
| if: matrix.python != '3.14' | |
| run: | | |
| python - <<'PY' | |
| from pathlib import Path | |
| project = Path("amulet-src/pyproject.toml") | |
| content = project.read_text() | |
| needle = 'requires-python = ">=3.14"' | |
| assert content.count(needle) == 1 | |
| project.write_text(content.replace(needle, 'requires-python = ">=3.12"')) | |
| PY | |
| cp .github/scripts/amulet_leveldb_smoke.py amulet-src/tests/test_backport_smoke.py | |
| git -C amulet-src diff --check | |
| - name: Setup Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python }} | |
| - name: Install cibuildwheel | |
| if: matrix.python != '3.14' | |
| run: python -m pip install 'cibuildwheel~=4.1' | |
| - name: Build and test Amulet wheel | |
| if: matrix.python != '3.14' | |
| 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: Setup uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| enable-cache: true | |
| - name: Test installed EndKeep with matched Amulet | |
| run: | | |
| uv venv .venv --python '${{ matrix.python }}' | |
| if [[ "${{ runner.os }}" == "Windows" ]]; then | |
| PYTHON=.venv/Scripts/python.exe | |
| else | |
| PYTHON=.venv/bin/python | |
| fi | |
| if [[ "${{ matrix.python }}" != "3.14" ]]; then | |
| uv pip install --python "$PYTHON" amulet-dist/*.whl | |
| fi | |
| uv pip install --python "$PYTHON" -e '.[dev]' | |
| uv pip check --python "$PYTHON" | |
| "$PYTHON" - <<'PY' | |
| from importlib.metadata import version | |
| from amulet.leveldb import LevelDB | |
| assert version("amulet-leveldb").split("+")[0] == "3.0.7a0" | |
| print("Amulet:", version("amulet-leveldb")) | |
| PY | |
| "$PYTHON" -m pytest -q | |
| - name: Save tested experimental backports (no Release) | |
| if: matrix.python != '3.14' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: amulet-compat-${{ matrix.os }}-${{ matrix.python }} | |
| path: amulet-dist/*.whl | |
| if-no-files-found: error | |
| retention-days: 7 |