Skip to content

Trim repo to only include stac-fastapi.pgstac package code #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 25 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
0d36b76
dont break on app startup when pagination extension is not included (…
geospatial-jeff Aug 4, 2022
397acac
add default CORS middleware (#441)
geospatial-jeff Aug 4, 2022
364fceb
Prep 2.4.0 (#445)
geospatial-jeff Aug 4, 2022
4369424
include stac_extensions when ingesting joplin test dataset (#446)
geospatial-jeff Aug 4, 2022
9f236be
replace ciso8601 with pyiso8601 (#448)
geospatial-jeff Aug 5, 2022
5e1ea82
update versions, prep changelog (#449)
geospatial-jeff Aug 5, 2022
bf0e972
Reduce to just stac-fastapi.pgstac package
duckontheweb Aug 6, 2022
89e5647
Get other stac_fastapi deps from GitHub
duckontheweb Aug 6, 2022
637fe26
Update Docker and Makefile config
duckontheweb Aug 6, 2022
e159005
Add missing test dependencies
duckontheweb Aug 6, 2022
d1a1e7e
Update publish script
duckontheweb Aug 6, 2022
6999301
Update CI/CD pipeline
duckontheweb Aug 6, 2022
ecdd5a9
Update CI/CD workflow name and main README
duckontheweb Aug 6, 2022
ec830ad
Fix lint error in setup.py
duckontheweb Aug 6, 2022
7ce83b5
Remove workflow to build and deploy docs
duckontheweb Aug 6, 2022
a996864
Revert "Remove workflow to build and deploy docs"
duckontheweb Aug 6, 2022
d42fd10
Update docs build
duckontheweb Aug 6, 2022
817e3e5
Mount test directory when running app
duckontheweb Aug 6, 2022
7ed24fb
Use more specific Docker network name
duckontheweb Aug 7, 2022
be943f8
Minor changes to publish script
duckontheweb Aug 7, 2022
cef6401
Update stac-fastapi dependency
duckontheweb Aug 11, 2022
4a28590
Use pgstac-specific Docker image name
duckontheweb Aug 11, 2022
b64213d
Update dependabot config
duckontheweb Aug 12, 2022
3c36277
Fix CI/CD config
duckontheweb Aug 12, 2022
d113ef8
Additional fixes based on review of SQLAlchemy backend PR
duckontheweb Aug 12, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 1 addition & 21 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,6 @@ updates:
schedule:
interval: weekly
- package-ecosystem: pip
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:
interval: weekly
- package-ecosystem: pip
directory: "/stac_fastapi/extensions"
schedule:
interval: weekly
- package-ecosystem: pip
directory: "/stac_fastapi/pgstac"
schedule:
interval: weekly
- package-ecosystem: pip
directory: "/stac_fastapi/sqlalchemy"
directory: "/stac_fastapi"
schedule:
interval: weekly
60 changes: 6 additions & 54 deletions .github/workflows/cicd.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: stac-fastapi
name: stac-fastapi-pgstac
on:
push:
branches: [ master ]
branches: [ main ]
pull_request:
branches: [ master ]
branches: [ main ]

jobs:
test:
Expand Down Expand Up @@ -46,61 +46,13 @@ jobs:
- name: Lint code
uses: pre-commit/action@v2.0.0

- name: Install pipenv
- name: Install stac-fastapi.pgstac
run: |
python -m pip install --upgrade pipenv wheel

- name: Install types
run: |
pip install ./stac_fastapi/types[dev]

- name: Install core api
run: |
pip install ./stac_fastapi/api[dev]

- name: Install Extensions
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/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
pip install .[dev,server]

- name: Run test suite
run: |
cd stac_fastapi/pgstac && pipenv run pytest -svvv
pytest -svvv
env:
ENVIRONMENT: testing
POSTGRES_USER: username
Expand Down
10 changes: 3 additions & 7 deletions .github/workflows/deploy_mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Publish docs via GitHub Pages
on:
push:
branches:
- master
- main
paths:
# Rebuild website when docs have changed or code has changed
- 'README.md'
Expand All @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest

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

- name: Set up Python 3.8
Expand All @@ -28,11 +28,7 @@ jobs:
- 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 -e .
python -m pip install mkdocs mkdocs-material pdocs

- name: update API docs
Expand Down
22 changes: 22 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,27 @@

### Added

### Changed

### Removed

### Fixed

## [2.4.1]

### Added

### Changed

### Removed

### Fixed
* `ciso8601` fails to build in some environments, instead use `pyiso8601` to parse datetimes.

## [2.4.0]

### Added

* Add hook to allow adding dependencies to routes. ([#295](https://github.com/stac-utils/stac-fastapi/pull/295))
* Ability to POST an ItemCollection to the collections/{collectionId}/items route. ([#367](https://github.com/stac-utils/stac-fastapi/pull/367))
* Add STAC API - Collections conformance class. ([383](https://github.com/stac-utils/stac-fastapi/pull/383))
Expand Down Expand Up @@ -43,6 +64,7 @@
from the request body, if present, and falls back to using the path parameter if no `"collection"` property is found in the body
([#425](https://github.com/stac-utils/stac-fastapi/pull/425))
* PGStac Backend Transactions endpoints return added Item/Collection instead of Item/Collection from request ([#424](https://github.com/stac-utils/stac-fastapi/pull/424))
* Application no longer breaks on startup when pagination extension is not included ([#444](https://github.com/stac-utils/stac-fastapi/pull/444))

## [2.3.0]

Expand Down
6 changes: 1 addition & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,4 @@ WORKDIR /app

COPY . /app

RUN pip install -e ./stac_fastapi/types[dev] && \
pip install -e ./stac_fastapi/api[dev] && \
pip install -e ./stac_fastapi/extensions[dev] && \
pip install -e ./stac_fastapi/sqlalchemy[dev,server] && \
pip install -e ./stac_fastapi/pgstac[dev,server]
RUN pip install -e .[dev,server]
8 changes: 2 additions & 6 deletions Dockerfile.docs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM python:3.8-slim

# build-essential is required to build a wheel for ciso8601
RUN apt update && apt install -y build-essential
RUN apt update && apt install -y build-essential git

RUN python -m pip install --upgrade pip
RUN python -m pip install mkdocs mkdocs-material pdocs
Expand All @@ -10,11 +10,7 @@ COPY . /opt/src

WORKDIR /opt/src

RUN python -m pip install \
stac_fastapi/api \
stac_fastapi/types \
stac_fastapi/extensions \
stac_fastapi/sqlalchemy
RUN python -m pip install .

CMD ["pdocs", \
"as_markdown", \
Expand Down
73 changes: 17 additions & 56 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,12 @@
APP_HOST ?= 0.0.0.0
APP_PORT ?= 8080
EXTERNAL_APP_PORT ?= ${APP_PORT}
run_sqlalchemy = docker-compose run --rm \
-p ${EXTERNAL_APP_PORT}:${APP_PORT} \
-e APP_HOST=${APP_HOST} \
-e APP_PORT=${APP_PORT} \
app-sqlalchemy

run_pgstac = docker-compose run --rm \
run_container = docker-compose run --rm \
-p ${EXTERNAL_APP_PORT}:${APP_PORT} \
-e APP_HOST=${APP_HOST} \
-e APP_PORT=${APP_PORT} \
app-pgstac
app

.PHONY: image
image:
Expand All @@ -22,63 +17,29 @@ image:
docker-run-all:
docker-compose up

.PHONY: docker-run-sqlalchemy
docker-run-sqlalchemy: image
$(run_sqlalchemy)

.PHONY: docker-run-pgstac
docker-run-pgstac: image
$(run_pgstac)

.PHONY: docker-shell-sqlalchemy
docker-shell-sqlalchemy:
$(run_sqlalchemy) /bin/bash

.PHONY: docker-shell-pgstac
docker-shell-pgstac:
$(run_pgstac) /bin/bash

.PHONY: test-sqlalchemy
test-sqlalchemy: run-joplin-sqlalchemy
$(run_sqlalchemy) /bin/bash -c 'export && ./scripts/wait-for-it.sh database:5432 && cd /app/stac_fastapi/sqlalchemy/tests/ && pytest -vvv'
.PHONY: docker-run-app
docker-run-app: image
$(run_app)

.PHONY: test-pgstac
test-pgstac:
$(run_pgstac) /bin/bash -c 'export && ./scripts/wait-for-it.sh database:5432 && cd /app/stac_fastapi/pgstac/tests/ && pytest -vvv'
.PHONY: docker-shell
docker-shell:
$(run_app) /bin/bash

.PHONY: test-api
test-api:
$(run_sqlalchemy) /bin/bash -c 'cd /app/stac_fastapi/api && pytest -svvv'
.PHONY: test
test:
$(run_app) /bin/bash -c 'export && ./scripts/wait-for-it.sh database:5432 && cd /app/tests/ && pytest -vvv'

.PHONY: run-database
run-database:
docker-compose run --rm database

.PHONY: run-joplin-sqlalchemy
run-joplin-sqlalchemy:
docker-compose run --rm loadjoplin-sqlalchemy

.PHONY: run-joplin-pgstac
run-joplin-pgstac:
docker-compose run --rm loadjoplin-pgstac

.PHONY: test
test: test-sqlalchemy test-pgstac

.PHONY: pybase-install
pybase-install:
pip install wheel && \
pip install -e ./stac_fastapi/api[dev] && \
pip install -e ./stac_fastapi/types[dev] && \
pip install -e ./stac_fastapi/extensions[dev]

.PHONY: pgstac-install
pgstac-install: pybase-install
pip install -e ./stac_fastapi/pgstac[dev,server]
.PHONY: run-joplin
run-joplin:
docker-compose run --rm loadjoplin

.PHONY: sqlalchemy-install
sqlalchemy-install: pybase-install
pip install -e ./stac_fastapi/sqlalchemy[dev,server]
.PHONY: install
pgstac-install:
pip install -e .[dev,server]

.PHONY: docs-image
docs-image:
Expand Down
Loading