Skip to content

Commit

Permalink
Merge branch 'main' into zcoleman/proxy-friendly-setting
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentsarago authored Apr 9, 2024
2 parents 066323e + 397de7e commit ff15018
Show file tree
Hide file tree
Showing 24 changed files with 648 additions and 116 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/cicd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,45 @@ jobs:
- uses: actions/checkout@v4
- name: Test generating docs
run: make docs

benchmark:
needs: [test]
runs-on: ubuntu-20.04
steps:
- name: Check out repository code
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install types
run: |
python -m pip install ./stac_fastapi/types[dev]
- name: Install extensions
run: |
python -m pip install ./stac_fastapi/extensions
- name: Install core api
run: |
python -m pip install ./stac_fastapi/api[dev,benchmark]
- 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

- 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' }}
9 changes: 4 additions & 5 deletions .github/workflows/deploy_mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ on:
# Rebuild website when docs have changed or code has changed
- "README.md"
- "docs/**"
- "mkdocs.yml"
- "**.py"
workflow_dispatch:

Expand All @@ -28,16 +27,16 @@ jobs:

- name: Install dependencies
run: |
pip install --upgrade pip
pip install \
python -m pip install --upgrade pip
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 @@ -51,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
14 changes: 14 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@

## [Unreleased]

### Added

* Add benchmark in CI ([#650](https://github.com/stac-utils/stac-fastapi/pull/650))

### Changed

* Improve bbox and datetime typing ([#490](https://github.com/stac-utils/stac-fastapi/pull/490)
* Add `items` link to inferred link relations ([#634](https://github.com/stac-utils/stac-fastapi/issues/634))
* 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))

### Removed

* Deprecate `response_class` option in `stac_fastapi.api.routes.create_async_endpoint` method ([#650](https://github.com/stac-utils/stac-fastapi/pull/650))

## [2.4.9] - 2023-11-17

### Added
Expand Down
24 changes: 12 additions & 12 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,31 @@ Issues and pull requests are more than welcome.
**dev install**

```bash
$ git clone https://github.com/stac-utils/stac-fastapi.git
$ cd stac-fastapi
$ pip install -e stac_fastapi/api[dev]
git clone https://github.com/stac-utils/stac-fastapi.git
cd stac-fastapi
python -m pip install -e stac_fastapi/api[dev]
```

**Python3.8 only**
**pre-commit**

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

```bash
$ pre-commit install
pre-commit install
```

### Docs

```bash
$ git clone https://github.com/stac-utils/stac-fastapi.git
$ cd stac-fastapi
$ pip install -e stac_fastapi/api["docs"]
git clone https://github.com/stac-utils/stac-fastapi.git
cd stac-fastapi
python pip install -e stac_fastapi/api["docs"]
```

Hot-reloading docs:

```bash
$ mkdocs serve
$ mkdocs serve -f docs/mkdocs.yml
```

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

# deploy
$ mkdocs gh-deploy
$ mkdocs gh-deploy -f docs/mkdocs.yml
```
1 change: 0 additions & 1 deletion docs/contributing.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/index.md

This file was deleted.

8 changes: 6 additions & 2 deletions mkdocs.yml → docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ site_description: STAC FastAPI.
# Repository
repo_name: "stac-utils/stac-fastapi"
repo_url: "https://github.com/stac-utils/stac-fastapi"
edit_uri: "blob/master/docs/src/"
edit_uri: "blob/main/docs/src/"

docs_dir: 'src'
site_dir: 'build'

# Social links
extra:
Expand All @@ -15,6 +18,7 @@ extra:
# Layout
nav:
- Home: "index.md"
- Tips and Tricks: tips-and-tricks.md
- API:
- packages: api/stac_fastapi/index.md
- stac_fastapi.api:
Expand Down Expand Up @@ -70,9 +74,9 @@ nav:
- search: api/stac_fastapi/types/search.md
- stac: api/stac_fastapi/types/stac.md
- version: api/stac_fastapi/types/version.md
- Performance Benchmarks: benchmarks.html
- Development - Contributing: "contributing.md"
- Release Notes: "release-notes.md"
- Tips and Tricks: tips-and-tricks.md

plugins:
- search
Expand Down
1 change: 0 additions & 1 deletion docs/release-notes.md

This file was deleted.

Loading

0 comments on commit ff15018

Please sign in to comment.