Skip to content

Commit

Permalink
update from main
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentsarago committed Apr 9, 2024
2 parents f97bc49 + 6e74b21 commit 47f9921
Show file tree
Hide file tree
Showing 164 changed files with 1,292 additions and 16,972 deletions.
12 changes: 0 additions & 12 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ updates:
directory: "/stac_fastapi/api"
schedule:
interval: weekly
- package-ecosystem: pip
directory: "/stac_fastapi/api"
schedule:
interval: weekly
- package-ecosystem: pip
directory: "/stac_fastapi/types"
schedule:
Expand All @@ -24,11 +20,3 @@ updates:
directory: "/stac_fastapi/extensions"
schedule:
interval: weekly
- package-ecosystem: pip
directory: "/stac_fastapi/pgstac"
schedule:
interval: weekly
- package-ecosystem: pip
directory: "/stac_fastapi/sqlalchemy"
schedule:
interval: weekly
158 changes: 44 additions & 114 deletions .github/workflows/cicd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ jobs:

steps:
- name: Check out repository code
uses: actions/checkout@v3
uses: actions/checkout@v4

# Setup Python (faster than using Python container)
- name: Setup Python
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -53,10 +53,6 @@ jobs:
python -m pip install pre-commit
pre-commit run --all-files
- name: Install pipenv
run: |
python -m pip install --upgrade pipenv wheel
- name: Install types
run: |
pip install ./stac_fastapi/types[dev]
Expand All @@ -69,122 +65,56 @@ jobs:
run: |
pip install ./stac_fastapi/extensions[dev]
- name: Install sqlalchemy stac-fastapi
run: |
pip install ./stac_fastapi/sqlalchemy[dev,server]
- name: Test
run: pytest -svvv
env:
ENVIRONMENT: testing

- name: Install pgstac stac-fastapi
run: |
pip install ./stac_fastapi/pgstac[dev,server]
test-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Test generating docs
run: make docs

- name: Run migration
run: |
cd stac_fastapi/sqlalchemy && alembic upgrade head
env:
POSTGRES_USER: username
POSTGRES_PASS: password
POSTGRES_DBNAME: postgis
POSTGRES_HOST: localhost
POSTGRES_PORT: 5432
benchmark:
needs: [test]
runs-on: ubuntu-20.04
steps:
- name: Check out repository code
uses: actions/checkout@v4

- name: Run test suite
run: |
cd stac_fastapi/api && pipenv run pytest -svvv
env:
ENVIRONMENT: testing
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Run test suite
- name: Install types
run: |
cd stac_fastapi/types && pipenv run pytest -svvv
env:
ENVIRONMENT: testing
python -m pip install ./stac_fastapi/types[dev]
- name: Run test suite
- name: Install extensions
run: |
cd stac_fastapi/sqlalchemy && pipenv run pytest -svvv
env:
ENVIRONMENT: testing
POSTGRES_USER: username
POSTGRES_PASS: password
POSTGRES_DBNAME: postgis
POSTGRES_HOST_READER: localhost
POSTGRES_HOST_WRITER: localhost
POSTGRES_PORT: 5432
python -m pip install ./stac_fastapi/extensions
- name: Run test suite
- name: Install core api
run: |
cd stac_fastapi/pgstac && pipenv run pytest -svvv
env:
ENVIRONMENT: testing
POSTGRES_USER: username
POSTGRES_PASS: password
POSTGRES_DBNAME: postgis
POSTGRES_HOST_READER: localhost
POSTGRES_HOST_WRITER: localhost
POSTGRES_PORT: 5432
python -m pip install ./stac_fastapi/api[dev,benchmark]
validate:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
backend: ["sqlalchemy", "pgstac"]
services:
pgstac:
image: ghcr.io/stac-utils/pgstac:v0.7.1
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@v3
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: "3.10"
cache: pip
cache-dependency-path: stac_fastapi/pgstac/setup.cfg
- name: Install stac-fastapi and stac-api-validator
run: pip install ./stac_fastapi/api ./stac_fastapi/types ./stac_fastapi/${{ matrix.backend }}[server] stac-api-validator==0.4.1
- name: Run migration
if: ${{ matrix.backend == 'sqlalchemy' }}
run: cd stac_fastapi/sqlalchemy && alembic upgrade head
env:
POSTGRES_USER: username
POSTGRES_PASS: password
POSTGRES_DBNAME: postgis
POSTGRES_HOST: localhost
POSTGRES_PORT: 5432
- name: Load data and validate
run: python -m stac_fastapi.${{ matrix.backend }}.app & ./scripts/wait-for-it.sh localhost:8080 && python ./scripts/ingest_joplin.py http://localhost:8080 && ./scripts/validate http://localhost:8080
env:
POSTGRES_USER: username
POSTGRES_PASS: password
POSTGRES_DBNAME: postgis
POSTGRES_HOST_READER: localhost
POSTGRES_HOST_WRITER: localhost
POSTGRES_PORT: 5432
PGUSER: username
PGPASSWORD: password
PGDATABASE: postgis
APP_HOST: 0.0.0.0
APP_PORT: 8080
- name: Run Benchmark
run: python -m pytest stac_fastapi/api/tests/benchmarks.py --benchmark-only --benchmark-columns 'min, max, mean, median' --benchmark-json output.json

test-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Test generating docs
run: make docs
- name: Store and benchmark result
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' }}
20 changes: 9 additions & 11 deletions .github/workflows/deploy_mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ on:
# Rebuild website when docs have changed or code has changed
- "README.md"
- "docs/**"
- "mkdocs.yml"
- "**.py"
workflow_dispatch:

jobs:
build:
Expand All @@ -18,27 +18,25 @@ jobs:

steps:
- name: Checkout main
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python 3.8
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: 3.8

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e \
stac_fastapi/api \
stac_fastapi/types \
stac_fastapi/extensions \
stac_fastapi/sqlalchemy
python -m pip install mkdocs mkdocs-material pdocs
python -m pip install \
stac_fastapi/api[docs] \
stac_fastapi/types[docs] \
stac_fastapi/extensions[docs] \
- name: update API docs
run: |
pdocs as_markdown \
--output_dir docs/api/ \
--output_dir docs/src/api/ \
--exclude_source \
--overwrite \
stac_fastapi
Expand All @@ -52,4 +50,4 @@ jobs:
POSTGRES_HOST_WRITER: localhost

- name: Deploy docs
run: mkdocs gh-deploy --force
run: mkdocs gh-deploy --force -f docs/mkdocs.yml
45 changes: 0 additions & 45 deletions .github/workflows/packages.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:
name: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python 3.x
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: "3.x"

Expand Down
65 changes: 9 additions & 56 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,57 +1,10 @@
repos:
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
language_version: python3.8
-
repo: https://github.com/psf/black
rev: 22.12.0
hooks:
- id: black
args: ['--safe']
language_version: python3.8
-
repo: https://github.com/pycqa/flake8
rev: 6.0.0
hooks:
- id: flake8
language_version: python3.8
args: [
# E501 let black handle all line length decisions
# W503 black conflicts with "line break before operator" rule
# E203 black conflicts with "whitespace before ':'" rule
'--ignore=E501,W503,E203,C901']
-
repo: https://github.com/chewse/pre-commit-mirrors-pydocstyle
# 2.1.1
rev: v2.1.1
hooks:
- id: pydocstyle
language_version: python3.8
exclude: '.*(test|alembic|scripts).*'
args: [
# Check for docstring presence only
'--select=D1',

]
# Don't require docstrings for tests
# '--match=(?!test).*\.py']
# -
# repo: https://github.com/pre-commit/mirrors-mypy
# rev: v0.770
# hooks:
# - id: mypy
# language_version: python3.8
# args: [--no-strict-optional, --ignore-missing-imports]
-
repo: https://github.com/PyCQA/pydocstyle
rev: 6.3.0
hooks:
- id: pydocstyle
language_version: python3.8
exclude: '.*(test|alembic|scripts).*'
#args: [
# Don't require docstrings for tests
#'--match=(?!test|alembic|scripts).*\.py',
#]
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.0.267"
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
Loading

0 comments on commit 47f9921

Please sign in to comment.