Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
78 changes: 41 additions & 37 deletions .github/workflows/cicd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,51 +5,59 @@ on:
pull_request:
branches: [main]

env:
LATEST_PY_VERSION: '3.14'

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

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

# Setup Python (faster than using Python container)
- name: Setup Python
uses: actions/setup-python@v6

- name: Install uv
uses: astral-sh/setup-uv@v3
with:
python-version: ${{ matrix.python-version }}

- name: Lint code
if: ${{ matrix.python-version == 3.13 }}
run: |
python -m pip install pre-commit
pre-commit run --all-files

- name: Install types
run: |
python -m pip install ./stac_fastapi/types[dev]
version: "0.9.*"
enable-cache: true

- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}

- name: Install core api
- name: Install dependencies
run: |
python -m pip install ./stac_fastapi/api[dev]
uv sync --all-extras

- name: Install Extensions
- name: Lint code
if: ${{ matrix.python-version == env.LATEST_PY_VERSION }}
run: |
python -m pip install ./stac_fastapi/extensions[dev]
uv run pre-commit run --all-files

- name: Test
run: python -m pytest -svvv
- name: Run tests
run: uv run pytest -svvv
env:
ENVIRONMENT: testing

test-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Checkout main
uses: actions/checkout@v5

- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "0.9.*"
enable-cache: true

- name: Set up Python3
run: uv python install 3

- name: Test generating docs
run: make docs

Expand All @@ -60,25 +68,21 @@ jobs:
- name: Check out repository code
uses: actions/checkout@v5

- name: Setup Python
uses: actions/setup-python@v6
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
python-version: "3.13"

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

- name: Install core api
run: |
python -m pip install ./stac_fastapi/api[dev,benchmark]
version: "0.9.*"
enable-cache: true

- name: Set up Python3
run: uv python install 3

- name: Install extensions
- name: Install dependencies
run: |
python -m pip install ./stac_fastapi/extensions
uv sync --all-extras

- 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
run: uv run pytest stac_fastapi/api/tests/benchmarks.py --benchmark-only --benchmark-columns 'min, max, mean, median' --benchmark-json output.json

- name: Store and benchmark result
if: github.repository == 'stac-utils/stac-fastapi'
Expand Down
22 changes: 13 additions & 9 deletions .github/workflows/deploy_mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,22 @@ jobs:
- name: Checkout main
uses: actions/checkout@v5

- name: Set up Python 3.11
uses: actions/setup-python@v6
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
python-version: 3.11
version: "0.9.*"
enable-cache: true

- name: Set up Python3
run: uv python install 3

- name: Install dependencies
run: |
uv sync --all-extras

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install \
stac_fastapi/types[docs] \
stac_fastapi/api[docs] \
stac_fastapi/extensions[docs] \
uv run pip install -r requirements/requirements-docs.txt

- name: Deploy docs
run: mkdocs gh-deploy --force -f docs/mkdocs.yml
run: uv run mkdocs gh-deploy --force -f docs/mkdocs.yml
19 changes: 9 additions & 10 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,18 @@ jobs:
steps:
- uses: actions/checkout@v5

- name: Set up Python 3.x
uses: actions/setup-python@v6
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
python-version: "3.x"

- name: Install release dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
version: "0.9.*"
enable-cache: true

- name: Set up Python3
run: uv python install 3

- name: Build and publish package
env:
TWINE_USERNAME: ${{ secrets.PYPI_STACUTILS_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_STACUTILS_PASSWORD }}
UV_PUBLISH_USERNAME: ${{ secrets.PYPI_STACUTILS_USERNAME }}
UV_PUBLISH_PASSWORD: ${{ secrets.PYPI_STACUTILS_PASSWORD }}
run: |
scripts/publish
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

## [Unreleased]

### Changed

- switch to pyproject.toml for package metadata
- use `uv` for project managment
- add python 3.14 support

## [6.0.0] - 2025-06-19

### Changed
Expand Down
13 changes: 8 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,38 @@ Issues and pull requests are more than welcome.
```bash
git clone https://github.com/stac-utils/stac-fastapi.git
cd stac-fastapi
python -m pip install -e stac_fastapi/api[dev]
uv sync --dev
```

**pre-commit**

This repo is set to use `pre-commit` to run *ruff*, *pydocstring* and mypy when committing new code.

```bash
pre-commit install
uv run pre-commit install

# If needed, you can run pre-commit script manually
uv run pre-commit run --all-files
```

### Docs

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

Hot-reloading docs:

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

To manually deploy docs (note you should never need to do this because GitHub
Actions deploys automatically for new commits.):

```bash
# deploy
$ mkdocs gh-deploy -f docs/mkdocs.yml
uv run mkdocs gh-deploy -f docs/mkdocs.yml
```
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ WORKDIR /app
COPY . /app

RUN python -m pip install \
-e ./stac_fastapi/types[dev] \
-e ./stac_fastapi/api[dev] \
-e ./stac_fastapi/extensions[dev]
-e ./stac_fastapi/types \
-e ./stac_fastapi/api \
-e ./stac_fastapi/extensions
19 changes: 0 additions & 19 deletions Dockerfile.docs

This file was deleted.

24 changes: 10 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,17 @@ image:

.PHONY: install
install:
python -m pip install wheel && \
python -m pip install -e ./stac_fastapi/types[dev] && \
python -m pip install -e ./stac_fastapi/api[dev] && \
python -m pip install -e ./stac_fastapi/extensions[dev]
uv sync --all-extras

.PHONY: docs-image
docs-image:
docker compose -f compose.docs.yml \
build
.PHONY: test
test: install
uv run pytest

.PHONY: docs
docs: docs-image
docker compose -f compose.docs.yml \
run docs
docs: install
uv run pip install -r requirements/requirements-docs.txt && \
uv run mkdocs build -f docs/mkdocs.yml

.PHONY: test
test: image
python -m pytest .
.PHONY: benchmark
benchmark: install
uv run pytest stac_fastapi/api/tests/benchmarks.py --benchmark-only --benchmark-columns 'min, max, mean, median'
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,13 @@ Other backends may be available from other sources, search [PyPI](https://pypi.o
Install the packages in editable mode:

```shell
python -m pip install \
-e 'stac_fastapi/types[dev]' \
-e 'stac_fastapi/api[dev]' \
-e 'stac_fastapi/extensions[dev]'
uv sync --dev
```

To run the tests:

```shell
python -m pytest
uv run pytest
```

## Releasing
Expand Down
2 changes: 1 addition & 1 deletion RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This is a checklist for releasing a new version of **stac-fastapi**.

Note: You can use [`bump-my-version`](https://github.com/callowayproject/bump-my-version) CLI
```
bump-my-version bump --new-version 3.1.0
uv run bump-my-version bump --new-version 3.1.0
```
4. Update [CHANGES.md](./CHANGES.md) for the new version. Add the appropriate header, and update the links at the bottom of the file.
Expand Down
9 changes: 0 additions & 9 deletions compose.docs.yml

This file was deleted.

41 changes: 41 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,39 @@
[project]
name = "stac-fastapi"
version = "6.0.0"
description = "Python library for building a STAC-compliant FastAPI application."
requires-python = ">=3.9"
readme = "README.md"
dependencies = []

[tool.uv.sources]
stac_fastapi_types = { workspace = true }
stac_fastapi_extensions = { workspace = true }
stac_fastapi_api = { workspace = true }

[tool.uv.workspace]
members = [
"stac_fastapi/*"
]

[tool.uv]
dev-dependencies = [
"pytest",
"pytest-cov",
"pytest-asyncio",
"pytest-benchmark",
"pre-commit",
"bump-my-version",
"httpx",
"requests",
# These are added as dev dependencies because they should be available
# when developing the project.
"stac_fastapi_types",
"stac_fastapi_api",
"stac_fastapi_extensions",
]
package = false

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

metadata for the whole repo (not a package)

[tool.ruff]
target-version = "py39" # minimum supported version
line-length = 90
Expand Down Expand Up @@ -61,6 +97,11 @@ filename = "VERSION"
search = "{current_version}"
replace = "{new_version}"

[[tool.bumpversion.files]]
filename = "stac_fastapi/pyproject.toml"
search = 'version = "{current_version}"'
replace = 'version = "{new_version}"'

[[tool.bumpversion.files]]
filename = "stac_fastapi/api/stac_fastapi/api/version.py"
search = '__version__ = "{current_version}"'
Expand Down
6 changes: 6 additions & 0 deletions requirements/requirements-docs.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
black>=23.10.1
mkdocs>=1.4.3
mkdocs-jupyter>=0.24.5
mkdocs-material[imaging]>=9.5
griffe-inherited-docstrings>=1.0.0
mkdocstrings[python]>=0.25.1
Loading
Loading