diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml new file mode 100644 index 0000000..ee1171a --- /dev/null +++ b/.buildkite/pipeline.yml @@ -0,0 +1,31 @@ +agents: + queue: hosted + +steps: + - label: ":pytest: pytest {{matrix}}" + command: ".buildkite/steps/test" + env: + PYTHON_VERSION: "{{matrix}}" + matrix: + - "3.9" + - "3.10" + - "3.11" + - "3.12" + - "3.13" + + - label: ":pytest: pytest 3.13 / pytest>=9" + command: ".buildkite/steps/test" + env: + PYTHON_VERSION: "3.13" + UV_RUN_FLAGS: "--with pytest>=9" + + - label: ":python: pylint {{matrix}}" + command: ".buildkite/steps/lint" + env: + PYTHON_VERSION: "{{matrix}}" + matrix: + - "3.9" + - "3.10" + - "3.11" + - "3.12" + - "3.13" diff --git a/.buildkite/steps/lint b/.buildkite/steps/lint new file mode 100755 index 0000000..0ee2422 --- /dev/null +++ b/.buildkite/steps/lint @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +set -o errexit +set -o pipefail +set -o nounset + +__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +__root="$(cd "$(dirname "${__dir}")"/../ && pwd)" + +cd "$__root" + +# Install uv +curl -LsSf https://astral.sh/uv/install.sh | sh +source "$HOME/.local/bin/env" + +# Install dependencies +uv python install "$PYTHON_VERSION" +uv sync --all-extras + +# Run pylint +uv run pylint src/ diff --git a/.buildkite/steps/test b/.buildkite/steps/test new file mode 100755 index 0000000..15de427 --- /dev/null +++ b/.buildkite/steps/test @@ -0,0 +1,30 @@ +#!/usr/bin/env bash + +set -o errexit +set -o pipefail +set -o nounset + +__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +__root="$(cd "$(dirname "${__dir}")"/../ && pwd)" + +cd "$__root" + +# Dogfood the collector: upload this repo's own test results to Test Engine. +# Uses an ephemeral OIDC token instead of a long-lived suite token, so this +# pipeline carries no secrets. +# https://buildkite.com/docs/pipelines/configure/tests/test-collection/oidc +SUITE_URL="https://buildkite.com/organizations/buildkite/analytics/suites/test-collector-python" +BUILDKITE_ANALYTICS_TOKEN="$(buildkite-agent oidc request-token --audience "$SUITE_URL" --lifetime 900)" +export BUILDKITE_ANALYTICS_TOKEN + +# Install uv +curl -LsSf https://astral.sh/uv/install.sh | sh +source "$HOME/.local/bin/env" + +# Install dependencies +uv python install "$PYTHON_VERSION" +uv sync --all-extras + +# Run tests (UV_RUN_FLAGS is intentionally word-split, e.g. "--with pytest>=9") +# shellcheck disable=SC2086 +uv run ${UV_RUN_FLAGS:-} pytest diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 7817c7d..0d23fbd 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -4,7 +4,3 @@ updates: directory: "/" schedule: interval: "daily" -- package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "weekly" diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml deleted file mode 100644 index 02cfbf8..0000000 --- a/.github/workflows/python.yaml +++ /dev/null @@ -1,55 +0,0 @@ -name: python - -on: - pull_request: - branches: - - main - push: - branches: - - main - -jobs: - pytest: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] - uv-run-flags: [""] - include: - - python-version: "3.13" - uv-run-flags: "--with 'pytest>=9'" - - env: - BUILDKITE_ANALYTICS_TOKEN: ${{ secrets.BUILDKITE_ANALYTICS_TOKEN }} - - steps: - - uses: actions/checkout@v6 - - name: Install uv - uses: astral-sh/setup-uv@v7 - with: - version: "latest" - - name: Set up Python ${{ matrix.python-version }} - run: uv python install ${{ matrix.python-version }} - - name: Install dependencies - run: uv sync --all-extras - - name: Run tests - run: uv run ${{ matrix.uv-run-flags }} pytest - - pylint: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] - - steps: - - uses: actions/checkout@v6 - - name: Install uv - uses: astral-sh/setup-uv@v7 - with: - version: "latest" - - name: Set up Python ${{ matrix.python-version }} - run: uv python install ${{ matrix.python-version }} - - name: Install dependencies - run: uv sync --all-extras - - name: Run pylint - run: uv run pylint src/