Skip to content

Commit

Permalink
Merge branch 'main' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
jonhealy1 authored Mar 29, 2024
2 parents b51612a + 4fb10ec commit c8fd8cf
Show file tree
Hide file tree
Showing 151 changed files with 777 additions and 16,380 deletions.
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
*.pyc
*.pyo
*.pyd
.tox
.coverage
.coverage.*
.vscode
Expand Down
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
7 changes: 3 additions & 4 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
**Related Issue(s):**
**Related Issue(s):**

- #

**Description:**


**PR Checklist:**

- [ ] Code is formatted and linted (run `pre-commit run --all-files`)
- [ ] `pre-commit` hooks pass locally
- [ ] Tests pass (run `make test`)
- [ ] Documentation has been updated to reflect changes, if applicable, and docs build successfully (run `make docs`)
- [ ] Changes are added to the [CHANGELOG](https://github.com/stac-utils/stac-fastapi/blob/master/CHANGES.md).
- [ ] Changes are added to the [CHANGELOG](https://github.com/stac-utils/stac-fastapi/blob/main/CHANGES.md).
131 changes: 10 additions & 121 deletions .github/workflows/cicd.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
name: stac-fastapi
on:
push:
branches: [master]
branches: [main]
pull_request:
branches: [master]
branches: [main]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
timeout-minutes: 10
timeout-minutes: 20

services:
db_service:
image: ghcr.io/stac-utils/pgstac:v0.6.12
image: ghcr.io/stac-utils/pgstac:v0.7.1
env:
POSTGRES_USER: username
POSTGRES_PASSWORD: password
Expand All @@ -32,17 +32,18 @@ jobs:
--health-interval 10s
--health-timeout 10s
--health-retries 10
--log-driver none
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432

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 @@ -52,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 @@ -68,122 +65,14 @@ jobs:
run: |
pip install ./stac_fastapi/extensions[dev]
- name: Install sqlalchemy stac-fastapi
run: |
pip install ./stac_fastapi/sqlalchemy[dev,server]
- name: Install pgstac stac-fastapi
run: |
pip install ./stac_fastapi/pgstac[dev,server]
- 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

- name: Run test suite
run: |
cd stac_fastapi/api && pipenv run pytest -svvv
env:
ENVIRONMENT: testing

- name: Run test suite
run: |
cd stac_fastapi/types && pipenv run pytest -svvv
env:
ENVIRONMENT: testing

- name: Run test suite
run: |
cd stac_fastapi/sqlalchemy && pipenv run pytest -svvv
- name: Test
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

- name: Run test suite
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

validate:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
backend: ["sqlalchemy", "pgstac"]
services:
pgstac:
image: ghcr.io/stac-utils/pgstac:v0.6.11
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
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
PGHOST: localhost
PGDATABASE: postgis
APP_HOST: 0.0.0.0
APP_PORT: 8080

test-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Test generating docs
run: make docs
29 changes: 14 additions & 15 deletions .github/workflows/deploy_mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,36 @@ name: Publish docs via GitHub Pages
on:
push:
branches:
- master
- main
paths:
# Rebuild website when docs have changed or code has changed
- 'README.md'
- 'docs/**'
- 'mkdocs.yml'
- '**.py'
- "README.md"
- "docs/**"
- "mkdocs.yml"
- "**.py"
workflow_dispatch:

jobs:
build:
name: Deploy docs
runs-on: ubuntu-latest

steps:
- name: Checkout master
uses: actions/checkout@v3
- name: Checkout main
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
pip install --upgrade pip
pip install \
stac_fastapi/api[docs] \
stac_fastapi/types[docs] \
stac_fastapi/extensions[docs] \
- name: update API docs
run: |
Expand Down
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
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
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.8.0
hooks:
- id: isort
language_version: python3.8
-
repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
args: ['--safe']
language_version: python3.8
-
repo: https://github.com/pycqa/flake8
rev: 3.9.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.0.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 c8fd8cf

Please sign in to comment.