switch to uv and pyproject.toml #2051
Workflow file for this run
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: stac-fastapi | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| env: | |
| LATEST_PY_VERSION: '3.14' | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] | |
| timeout-minutes: 20 | |
| steps: | |
| - name: Check out repository code | |
| uses: actions/checkout@v5 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v3 | |
| with: | |
| version: "0.9.*" | |
| enable-cache: true | |
| - name: Set up Python ${{ matrix.python-version }} | |
| run: uv python install ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| uv sync --all-extras | |
| - name: Lint code | |
| if: ${{ matrix.python-version == env.LATEST_PY_VERSION }} | |
| run: | | |
| uv run pre-commit run --all-files | |
| - name: Run tests | |
| run: uv run pytest -svvv | |
| env: | |
| ENVIRONMENT: testing | |
| test-docs: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout main | |
| uses: actions/checkout@v5 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v3 | |
| with: | |
| version: "0.9.*" | |
| enable-cache: true | |
| - name: Set up Python3 | |
| run: uv python install 3 | |
| - name: Test generating docs | |
| run: make docs | |
| benchmark: | |
| needs: [test] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repository code | |
| uses: actions/checkout@v5 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v3 | |
| with: | |
| version: "0.9.*" | |
| enable-cache: true | |
| - name: Set up Python3 | |
| run: uv python install 3 | |
| - name: Install dependencies | |
| run: | | |
| uv sync --all-extras | |
| - name: Run Benchmark | |
| run: uv run pytest stac_fastapi/api/tests/benchmarks.py --benchmark-only --benchmark-columns 'min, max, mean, median' --benchmark-json output.json | |
| - name: Store and benchmark result | |
| if: github.repository == 'stac-utils/stac-fastapi' | |
| uses: benchmark-action/github-action-benchmark@v1 | |
| with: | |
| name: STAC FastAPI Benchmarks | |
| tool: 'pytest' | |
| output-file-path: output.json | |
| alert-threshold: '130%' | |
| comment-on-alert: true | |
| fail-on-alert: false | |
| # GitHub API token to make a commit comment | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| gh-pages-branch: 'gh-benchmarks' | |
| # Make a commit only if main | |
| auto-push: ${{ github.ref == 'refs/heads/main' }} |