diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3d3c6d26..c934eaa1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,7 +11,7 @@ on: jobs: validate-release-request: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: Validate release PR uses: edgedb/action-release/validate-pr@master @@ -44,7 +44,7 @@ jobs: build-sdist: needs: validate-release-request - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 env: PIP_DISABLE_PIP_VERSION_CHECK: 1 @@ -63,8 +63,8 @@ jobs: - name: Build source distribution run: | - pip install -U setuptools wheel pip - python setup.py sdist + pip install -U setuptools wheel build + python -m build --sdist - uses: actions/upload-artifact@v4 with: @@ -73,7 +73,7 @@ jobs: build-wheels-matrix: needs: validate-release-request - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 outputs: include: ${{ steps.set-matrix.outputs.include }} steps: @@ -84,18 +84,26 @@ jobs: with: python-version: "3.x" - name: Install cibuildwheel - run: pip install cibuildwheel==3.3.0 + run: pip install cibuildwheel==3.3.1 - name: Build cibuildwheel matrix id: set-matrix + env: + # skipping pypy for now + CIBW_SKIP: > + pp* run: | + set -euo pipefail MATRIX_INCLUDE=$( { - cibuildwheel --print-build-identifiers --platform linux --archs x86_64,aarch64 | grep cp | jq -nRc '{"only": inputs, "os": "ubuntu-latest"}' \ - && cibuildwheel --print-build-identifiers --platform macos --archs x86_64,arm64 | grep cp | jq -nRc '{"only": inputs, "os": "macos-latest"}' \ - && cibuildwheel --print-build-identifiers --platform windows --archs x86,AMD64 | grep cp | jq -nRc '{"only": inputs, "os": "windows-latest"}' + cibuildwheel --print-build-identifiers --platform linux --archs x86_64 | jq -nRc '{"only": inputs, "os": "ubuntu-24.04"}' \ + && cibuildwheel --print-build-identifiers --platform linux --archs aarch64 | jq -nRc '{"only": inputs, "os": "ubuntu-24.04-arm"}' \ + && cibuildwheel --print-build-identifiers --platform macos --archs x86_64 | jq -nRc '{"only": inputs, "os": "macos-15-intel"}' \ + && cibuildwheel --print-build-identifiers --platform macos --archs arm64 | jq -nRc '{"only": inputs, "os": "macos-15"}' \ + && cibuildwheel --print-build-identifiers --platform windows --archs x86,AMD64 | jq -nRc '{"only": inputs, "os": "windows-2025"}' \ + && cibuildwheel --print-build-identifiers --platform windows --archs ARM64 | jq -nRc '{"only": inputs, "os": "windows-11-arm"}' } | jq -sc ) - echo "include=$MATRIX_INCLUDE" >> $GITHUB_OUTPUT + echo "include=$MATRIX_INCLUDE" >> "$GITHUB_OUTPUT" build-wheels: needs: build-wheels-matrix @@ -125,7 +133,7 @@ jobs: if: runner.os == 'Linux' uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0 - - uses: pypa/cibuildwheel@63fd63b352a9a8bdcc24791c9dbee952ee9a8abc # v3.3.0 + - uses: pypa/cibuildwheel@298ed2fb2c105540f5ed055e8a6ad78d82dd3a7e # v3.3.1 with: only: ${{ matrix.only }} env: @@ -137,7 +145,7 @@ jobs: path: wheelhouse/*.whl merge-artifacts: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 needs: [build-sdist, build-wheels] steps: - name: Merge Artifacts @@ -148,7 +156,7 @@ jobs: publish-docs: needs: [build-sdist, build-wheels] - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 env: PIP_DISABLE_PIP_VERSION_CHECK: 1 @@ -197,7 +205,7 @@ jobs: publish: needs: [build-sdist, build-wheels, publish-docs] - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 environment: name: pypi @@ -224,7 +232,7 @@ jobs: id: relver run: | set -e - echo "version=$(cat dist/VERSION)" >> $GITHUB_OUTPUT + echo "version=$(cat dist/VERSION)" >> "$GITHUB_OUTPUT" rm dist/VERSION - name: Merge and tag the PR diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 896d1cb4..09b3b937 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -9,6 +9,10 @@ on: branches: - master +concurrency: # https://stackoverflow.com/questions/66335225#comment133398800_72408109 + group: ${{ github.workflow }}-${{ github.ref || github.run_id }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + jobs: test-platforms: # NOTE: this matrix is for testing various combinations of Python and OS @@ -18,17 +22,20 @@ jobs: strategy: matrix: python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14", "3.14t", "3.15", "3.15t"] - os: [ubuntu-latest, macos-latest, windows-latest] + os: [ubuntu-24.04, macos-15, windows-2025] loop: [asyncio, uvloop] exclude: # uvloop does not support windows - loop: uvloop - os: windows-latest + os: windows-2025 # The test dependency group excludes uvloop on Python 3.15. - loop: uvloop python-version: "3.15" - loop: uvloop python-version: "3.15t" + # github does not provide 3.9 cpython for arm64 runners + - python-version: "3.9" + os: macos-15 runs-on: ${{ matrix.os }} @@ -38,9 +45,6 @@ jobs: run: shell: bash - env: - PIP_DISABLE_PIP_VERSION_CHECK: 1 - steps: - uses: actions/checkout@v5 with: @@ -58,53 +62,44 @@ jobs: version_line_pattern: | __version__(?:\s*:\s*typing\.Final)?\s*=\s*(?:['"])([[:PEP440:]])(?:['"]) - - name: Setup PostgreSQL - if: "!steps.release.outputs.is_release && matrix.os == 'macos-latest'" + - name: Set up PostgreSQL + if: "!steps.release.outputs.is_release && startsWith(matrix.os, 'macos')" run: | POSTGRES_FORMULA="postgresql@18" brew install "$POSTGRES_FORMULA" - echo "$(brew --prefix "$POSTGRES_FORMULA")/bin" >> $GITHUB_PATH + echo "$(brew --prefix "$POSTGRES_FORMULA")/bin" >> "$GITHUB_PATH" + + - name: Set up Kerberos + if: "!steps.release.outputs.is_release && startsWith(matrix.os, 'ubuntu')" + run: .github/workflows/install-krb5.sh - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v6 + uses: astral-sh/setup-uv@v7 if: "!steps.release.outputs.is_release" with: python-version: ${{ matrix.python-version }} - # Track the latest 3.15 build, including prereleases before GA. - allow-prereleases: ${{ startsWith(matrix.python-version, '3.15') }} - check-latest: ${{ startsWith(matrix.python-version, '3.15') }} + activate-environment: true - name: Install Python Deps if: "!steps.release.outputs.is_release" run: | - [ "$RUNNER_OS" = "Linux" ] && .github/workflows/install-krb5.sh - python -m pip install -U pip setuptools wheel - python -m pip install --group test - python -m pip install -e . + uv pip install -e . --group test - name: Test if: "!steps.release.outputs.is_release" env: - LOOP_IMPL: ${{ matrix.loop }} - run: | - if [ "${LOOP_IMPL}" = "uvloop" ]; then - env USE_UVLOOP=1 python -m unittest -v tests.suite - else - python -m unittest -v tests.suite - fi + USE_UVLOOP: ${{ matrix.loop == 'uvloop' && '1' || '' }} + run: python -m unittest -v tests.suite test-postgres: strategy: matrix: postgres-version: ["9.5", "9.6", "10", "11", "12", "13", "14", "15", "16", "17", "18"] - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 permissions: {} - env: - PIP_DISABLE_PIP_VERSION_CHECK: 1 - steps: - uses: actions/checkout@v5 with: @@ -133,19 +128,21 @@ jobs: echo PGINSTALLATION="/usr/lib/postgresql/${PGVERSION}/bin" \ >> "${GITHUB_ENV}" - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v6 + - name: Set up Kerberos + if: "!steps.release.outputs.is_release" + run: .github/workflows/install-krb5.sh + + - name: Set up Python + uses: astral-sh/setup-uv@v7 if: "!steps.release.outputs.is_release" with: - python-version: "3.x" + python-version: "3.14" + activate-environment: true - name: Install Python Deps if: "!steps.release.outputs.is_release" run: | - [ "$RUNNER_OS" = "Linux" ] && .github/workflows/install-krb5.sh - python -m pip install -U pip setuptools wheel - python -m pip install --group test - python -m pip install -e . + uv pip install -e . --group test - name: Test if: "!steps.release.outputs.is_release" @@ -159,7 +156,7 @@ jobs: regression-tests: name: "Regression Tests" needs: [test-platforms, test-postgres] - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 permissions: {} steps: diff --git a/pyproject.toml b/pyproject.toml index 66a6fbe9..d93d4bff 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -63,7 +63,7 @@ docs = [ requires = [ "setuptools>=77.0.3", "packaging>=24.0", - "Cython(>=3.2.1,<4.0.0)" + "Cython>=3.2.1,<4.0.0" ] build-backend = "setuptools.build_meta" diff --git a/setup.py b/setup.py index 76a5c40a..f93b8ca7 100644 --- a/setup.py +++ b/setup.py @@ -27,7 +27,7 @@ from setuptools.command import build_ext as setuptools_build_ext -CYTHON_DEPENDENCY = 'Cython(>=3.2.1,<4.0.0)' +CYTHON_DEPENDENCY = 'Cython>=3.2.1,<4.0.0' CFLAGS = ['-O2'] LDFLAGS = []