switch to uv+pyproject.toml and move docs #682
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] | |
| workflow_dispatch: | |
| env: | |
| LATEST_PY_VERSION: '3.13' | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| # NOTE: removing python 3.14 while https://github.com/developmentseed/cql2-rs/issues/93 | |
| 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@v7 | |
| with: | |
| version: "0.9.*" | |
| enable-cache: true | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| uv sync | |
| - name: Lint code | |
| if: ${{ matrix.python-version == env.LATEST_PY_VERSION }} | |
| run: | | |
| uv run pre-commit run --all-files | |
| - name: install lib postgres | |
| uses: nyurik/action-setup-postgis@v2 | |
| - name: Run test suite | |
| run: uv run pytest --cov stac_fastapi.pgstac --cov-report xml --cov-report term-missing | |
| validate: | |
| runs-on: ubuntu-latest | |
| services: | |
| pgstac: | |
| image: ghcr.io/stac-utils/pgstac:v0.9.8 | |
| env: | |
| POSTGRES_USER: username | |
| POSTGRES_PASSWORD: password | |
| POSTGRES_DB: postgis | |
| PGUSER: username | |
| PGPASSWORD: password | |
| PGDATABASE: postgis | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| --log-driver none | |
| ports: | |
| - 5432:5432 | |
| steps: | |
| - name: Check out repository code | |
| uses: actions/checkout@v5 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| version: "0.9.*" | |
| enable-cache: true | |
| python-version: ${{ env.LATEST_PY_VERSION }} | |
| - name: Install dependencies | |
| run: | | |
| uv sync | |
| uv pip install stac-api-validator==0.6.5 | |
| - name: Load data and validate | |
| run: uv run python -m stac_fastapi.pgstac.app & ./scripts/wait-for-it.sh localhost:8080 && uv run ./scripts/ingest_joplin.py http://localhost:8080 && uv run ./scripts/validate http://localhost:8080 | |
| env: | |
| PGUSER: username | |
| PGPASSWORD: password | |
| PGHOST: localhost | |
| PGPORT: 5432 | |
| PGDATABASE: postgis | |
| APP_HOST: 0.0.0.0 | |
| APP_PORT: 8080 | |
| ENABLE_TRANSACTIONS_EXTENSIONS: TRUE | |
| test-docs: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout main | |
| uses: actions/checkout@v5 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| version: "0.9.*" | |
| enable-cache: true | |
| python-version: ${{ env.LATEST_PY_VERSION }} | |
| - name: Test docs | |
| run: | | |
| uv run --group docs mkdocs build -f docs/mkdocs.yml |