Skip to content

feat: Support R2 URLs with jurisdictions #1503

feat: Support R2 URLs with jurisdictions

feat: Support R2 URLs with jurisdictions #1503

Workflow file for this run

name: Python
on:
push:
branches:
- main
pull_request:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
pre-commit:
name: Run pre-commit on Python code
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: "3.11"
# Use ruff-action so we get annotations in the Github UI
- uses: astral-sh/ruff-action@278981a28ce3188b1e39527901f38254bf3aac89 # v4.1.0
- name: Cache pre-commit virtualenvs
uses: actions/cache@v6
with:
path: ~/.cache/pre-commit
key: pre-commit-3|${{ hashFiles('.pre-commit-config.yaml') }}
- name: run pre-commit
run: |
python -m pip install pre-commit
pre-commit run --all-files
test-python:
name: Build and test Python
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.14t"]
steps:
- uses: actions/checkout@v7
- name: Install Rust
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
with:
# rust-cache normalizes version numbers before hashing Cargo.lock,
# so minor/patch dep bumps don't invalidate the cache. Append the
# raw lockfile hash (and matrix Python version) to force a fresh
# cache entry whenever Cargo.lock actually changes.
key: ${{ matrix.python-version }}-${{ hashFiles('**/Cargo.lock') }}
- name: Install uv
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
with:
enable-cache: true
version: "0.10.x"
- name: Set up Python
run: uv python install ${{ matrix.python-version }}
- name: Build rust submodules
run: |
uv run --python ${{ matrix.python-version }} maturin develop -m obstore/Cargo.toml
- name: Run python tests
if: "!endsWith(matrix.python-version, 't')"
run: |
uv run --python ${{ matrix.python-version }} pytest tests
- name: Run python tests with --parallel-threads=2
if: "endsWith(matrix.python-version, 't')"
run: |
uv run --python ${{ matrix.python-version }} pytest tests --parallel-threads=2
# Ensure docs build without warnings
- name: Check docs
if: "${{ matrix.python-version == 3.11 }}"
run: uv run --group docs mkdocs build --strict
- name: Add venv to PATH (for pyright action)
run: echo "$PWD/.venv/bin" >> $GITHUB_PATH
- name: Run pyright
uses: jakebailey/pyright-action@8ec14b5cfe41f26e5f41686a31eb6012758217ef # v3.0.2
with:
# Restore pylance-version: latest-release
# once it uses >1.1.405
# https://github.com/microsoft/pyright/issues/10906
version: 1.1.406
# pylance-version: latest-release