Skip to content

Commit e579311

Browse files
committed
update from main
2 parents 6cae792 + 315cfae commit e579311

File tree

32 files changed

+743
-189
lines changed

32 files changed

+743
-189
lines changed

.github/workflows/cicd.yaml

Lines changed: 47 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -10,33 +10,9 @@ jobs:
1010
runs-on: ubuntu-latest
1111
strategy:
1212
matrix:
13-
python-version: ["3.8", "3.9", "3.10", "3.11"]
13+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
1414
timeout-minutes: 20
1515

16-
services:
17-
db_service:
18-
image: ghcr.io/stac-utils/pgstac:v0.7.1
19-
env:
20-
POSTGRES_USER: username
21-
POSTGRES_PASSWORD: password
22-
POSTGRES_DB: postgis
23-
POSTGRES_HOST: localhost
24-
POSTGRES_PORT: 5432
25-
PGUSER: username
26-
PGPASSWORD: password
27-
PGDATABASE: postgis
28-
ALLOW_IP_RANGE: 0.0.0.0/0
29-
# Set health checks to wait until postgres has started
30-
options: >-
31-
--health-cmd pg_isready
32-
--health-interval 10s
33-
--health-timeout 10s
34-
--health-retries 10
35-
--log-driver none
36-
ports:
37-
# Maps tcp port 5432 on service container to the host
38-
- 5432:5432
39-
4016
steps:
4117
- name: Check out repository code
4218
uses: actions/checkout@v4
@@ -55,18 +31,18 @@ jobs:
5531
5632
- name: Install types
5733
run: |
58-
pip install ./stac_fastapi/types[dev]
34+
python -m pip install ./stac_fastapi/types[dev]
5935
6036
- name: Install core api
6137
run: |
62-
pip install ./stac_fastapi/api[dev]
38+
python -m pip install ./stac_fastapi/api[dev]
6339
6440
- name: Install Extensions
6541
run: |
66-
pip install ./stac_fastapi/extensions[dev]
42+
python -m pip install ./stac_fastapi/extensions[dev]
6743
6844
- name: Test
69-
run: pytest -svvv
45+
run: python -m pytest -svvv
7046
env:
7147
ENVIRONMENT: testing
7248

@@ -76,3 +52,45 @@ jobs:
7652
- uses: actions/checkout@v4
7753
- name: Test generating docs
7854
run: make docs
55+
56+
benchmark:
57+
needs: [test]
58+
runs-on: ubuntu-20.04
59+
steps:
60+
- name: Check out repository code
61+
uses: actions/checkout@v4
62+
63+
- name: Setup Python
64+
uses: actions/setup-python@v5
65+
with:
66+
python-version: "3.11"
67+
68+
- name: Install types
69+
run: |
70+
python -m pip install ./stac_fastapi/types[dev]
71+
72+
- name: Install core api
73+
run: |
74+
python -m pip install ./stac_fastapi/api[dev,benchmark]
75+
76+
- name: Install extensions
77+
run: |
78+
python -m pip install ./stac_fastapi/extensions
79+
80+
- name: Run Benchmark
81+
run: python -m pytest stac_fastapi/api/tests/benchmarks.py --benchmark-only --benchmark-columns 'min, max, mean, median' --benchmark-json output.json
82+
83+
- name: Store and benchmark result
84+
uses: benchmark-action/github-action-benchmark@v1
85+
with:
86+
name: STAC FastAPI Benchmarks
87+
tool: 'pytest'
88+
output-file-path: output.json
89+
alert-threshold: '130%'
90+
comment-on-alert: true
91+
fail-on-alert: false
92+
# GitHub API token to make a commit comment
93+
github-token: ${{ secrets.GITHUB_TOKEN }}
94+
gh-pages-branch: 'gh-benchmarks'
95+
# Make a commit only if main
96+
auto-push: ${{ github.ref == 'refs/heads/main' }}

.github/workflows/deploy_mkdocs.yml

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ on:
88
# Rebuild website when docs have changed or code has changed
99
- "README.md"
1010
- "docs/**"
11-
- "mkdocs.yml"
1211
- "**.py"
1312
workflow_dispatch:
1413

@@ -28,27 +27,19 @@ jobs:
2827

2928
- name: Install dependencies
3029
run: |
31-
pip install --upgrade pip
32-
pip install \
33-
stac_fastapi/api[docs] \
30+
python -m pip install --upgrade pip
31+
python -m pip install \
3432
stac_fastapi/types[docs] \
33+
stac_fastapi/api[docs] \
3534
stac_fastapi/extensions[docs] \
3635
3736
- name: update API docs
3837
run: |
3938
pdocs as_markdown \
40-
--output_dir docs/api/ \
39+
--output_dir docs/src/api/ \
4140
--exclude_source \
4241
--overwrite \
4342
stac_fastapi
44-
env:
45-
POSTGRES_USER: username
46-
POSTGRES_PASS: password
47-
POSTGRES_DBNAME: postgis
48-
POSTGRES_HOST: localhost
49-
POSTGRES_PORT: 5432
50-
POSTGRES_HOST_READER: localhost
51-
POSTGRES_HOST_WRITER: localhost
5243
5344
- name: Deploy docs
54-
run: mkdocs gh-deploy --force
45+
run: mkdocs gh-deploy --force -f docs/mkdocs.yml

CHANGES.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,22 @@
44

55
### Added
66

7+
* Add benchmark in CI ([#650](https://github.com/stac-utils/stac-fastapi/pull/650))
8+
* Add `/queryables` link to the landing page ([#587](https://github.com/stac-utils/stac-fastapi/pull/587))
79
- `id`, `title`, `description` and `api_version` fields can be customized via env variables
810

11+
### Changed
12+
13+
* Updated the collection update endpoint to match with the collection-transaction extension. ([#630](https://github.com/stac-utils/stac-fastapi/issues/630))
14+
* Improve bbox and datetime typing ([#490](https://github.com/stac-utils/stac-fastapi/pull/490)
15+
* Add `items` link to inferred link relations ([#634](https://github.com/stac-utils/stac-fastapi/issues/634))
16+
* Make sure FastAPI uses Pydantic validation and serialization by not wrapping endpoint output with a Response object ([#650](https://github.com/stac-utils/stac-fastapi/pull/650))
17+
* Allow `GeometryCollections` for `intersects` parameter in POST search queries ([#548](https://github.com/stac-utils/stac-fastapi/pull/548))
18+
19+
### Removed
20+
21+
* Deprecate `response_class` option in `stac_fastapi.api.routes.create_async_endpoint` method ([#650](https://github.com/stac-utils/stac-fastapi/pull/650))
22+
923
## [2.4.9] - 2023-11-17
1024

1125
### Added

CONTRIBUTING.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,31 @@ Issues and pull requests are more than welcome.
55
**dev install**
66

77
```bash
8-
$ git clone https://github.com/stac-utils/stac-fastapi.git
9-
$ cd stac-fastapi
10-
$ pip install -e stac_fastapi/api[dev]
8+
git clone https://github.com/stac-utils/stac-fastapi.git
9+
cd stac-fastapi
10+
python -m pip install -e stac_fastapi/api[dev]
1111
```
1212

13-
**Python3.8 only**
13+
**pre-commit**
1414

15-
This repo is set to use `pre-commit` to run *ruff*, *pydocstring*, *black* ("uncompromising Python code formatter") and mypy when committing new code.
15+
This repo is set to use `pre-commit` to run *ruff*, *pydocstring* and mypy when committing new code.
1616

1717
```bash
18-
$ pre-commit install
18+
pre-commit install
1919
```
2020

2121
### Docs
2222

2323
```bash
24-
$ git clone https://github.com/stac-utils/stac-fastapi.git
25-
$ cd stac-fastapi
26-
$ pip install -e stac_fastapi/api["docs"]
24+
git clone https://github.com/stac-utils/stac-fastapi.git
25+
cd stac-fastapi
26+
python pip install -e stac_fastapi/api["docs"]
2727
```
2828

2929
Hot-reloading docs:
3030

3131
```bash
32-
$ mkdocs serve
32+
$ mkdocs serve -f docs/mkdocs.yml
3333
```
3434

3535
To manually deploy docs (note you should never need to do this because GitHub
@@ -38,11 +38,11 @@ Actions deploys automatically for new commits.):
3838
```bash
3939
Create API documentations
4040
$ pdocs as_markdown \
41-
--output_dir docs/api/ \
41+
--output_dir docs/src/api/ \
4242
--exclude_source \
4343
--overwrite \
4444
stac_fastapi
4545

4646
# deploy
47-
$ mkdocs gh-deploy
47+
$ mkdocs gh-deploy -f docs/mkdocs.yml
4848
```

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ WORKDIR /app
1616

1717
COPY . /app
1818

19-
RUN pip install -e ./stac_fastapi/types[dev] && \
20-
pip install -e ./stac_fastapi/api[dev] && \
21-
pip install -e ./stac_fastapi/extensions[dev]
19+
RUN python -m pip install -e ./stac_fastapi/types[dev] && \
20+
python -m pip install -e ./stac_fastapi/api[dev] && \
21+
python -m pip install -e ./stac_fastapi/extensions[dev]

Dockerfile.docs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ COPY . /opt/src
1111
WORKDIR /opt/src
1212

1313
RUN python -m pip install \
14-
stac_fastapi/api \
1514
stac_fastapi/types \
15+
stac_fastapi/api \
1616
stac_fastapi/extensions
1717

1818
CMD ["pdocs", \
@@ -21,4 +21,4 @@ CMD ["pdocs", \
2121
"docs/api/", \
2222
"--exclude_source", \
2323
"--overwrite", \
24-
"stac_fastapi"]
24+
"stac_fastapi"]

Makefile

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ image:
44

55
.PHONY: install
66
install:
7-
pip install wheel && \
8-
pip install -e ./stac_fastapi/api[dev] && \
9-
pip install -e ./stac_fastapi/types[dev] && \
10-
pip install -e ./stac_fastapi/extensions[dev]
7+
python -m pip install wheel && \
8+
python -m pip install -e ./stac_fastapi/types[dev] && \
9+
python -m pip install -e ./stac_fastapi/api[dev] && \
10+
python -m pip install -e ./stac_fastapi/extensions[dev]
1111

1212
.PHONY: docs-image
1313
docs-image:
@@ -18,3 +18,7 @@ docs-image:
1818
docs: docs-image
1919
docker-compose -f docker-compose.docs.yml \
2020
run docs
21+
22+
.PHONY: test
23+
test: image
24+
python -m pytest .

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@ Backends are hosted in their own repositories:
4545

4646
```bash
4747
# Install from PyPI
48-
pip install stac-fastapi.api stac-fastapi.types stac-fastapi.extensions
48+
python -m pip install stac-fastapi.types stac-fastapi.api stac-fastapi.extensions
4949

5050
# Install a backend of your choice
51-
pip install stac-fastapi.sqlalchemy
51+
python -m pip install stac-fastapi.sqlalchemy
5252
# or
53-
pip install stac-fastapi.pgstac
53+
python -m pip install stac-fastapi.pgstac
5454
```
5555

5656
Other backends may be available from other sources, search [PyPI](https://pypi.org/) for more.
@@ -60,14 +60,14 @@ Other backends may be available from other sources, search [PyPI](https://pypi.o
6060
Install the packages in editable mode:
6161

6262
```shell
63-
pip install -e \
64-
'stac_fastapi/api[dev]' \
63+
python -m pip install -e \
6564
'stac_fastapi/types[dev]' \
65+
'stac_fastapi/api[dev]' \
6666
'stac_fastapi/extensions[dev]'
6767
```
6868

6969
To run the tests:
7070

7171
```shell
72-
pytest
72+
python -m pytest
7373
```

docs/contributing.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/index.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)