Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
18 changes: 6 additions & 12 deletions .github/workflows/cicd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
uses: actions/checkout@v5

- name: Install uv
uses: astral-sh/setup-uv@v3
uses: astral-sh/setup-uv@v7
with:
version: "0.9.*"
enable-cache: true
Expand All @@ -31,7 +31,7 @@ jobs:

- name: Install dependencies
run: |
uv sync --dev
uv sync

- name: Lint code
if: ${{ matrix.python-version == env.LATEST_PY_VERSION }}
Expand All @@ -50,17 +50,14 @@ jobs:
uses: actions/checkout@v5

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

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

- name: Test docs
run: |
uvx --with-requirements requirements/requirements-docs.txt mkdocs build -f docs/mkdocs.yml
uv run --group docs mkdocs build -f docs/mkdocs.yml

benchmark:
needs: [test]
Expand All @@ -70,17 +67,14 @@ jobs:
uses: actions/checkout@v5

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

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

- name: Install dependencies
run: |
uv sync --dev
uv sync

- name: Run Benchmark
run: uv run pytest stac_fastapi/api/tests/benchmarks.py --benchmark-only --benchmark-columns 'min, max, mean, median' --benchmark-json output.json
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/deploy_mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,10 @@ jobs:
uses: actions/checkout@v5

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

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

- name: Deploy docs
run: uvx --with-requirements requirements/requirements-docs.txt mkdocs gh-deploy --force -f docs/mkdocs.yml
run: uv run --group docs mkdocs gh-deploy --force -f docs/mkdocs.yml
5 changes: 1 addition & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,11 @@ jobs:
- uses: actions/checkout@v5

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

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

- name: Build and publish package
env:
UV_PUBLISH_USERNAME: ${{ secrets.PYPI_STACUTILS_USERNAME }}
Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,19 @@ uv run pre-commit run --all-files
git clone https://github.com/stac-utils/stac-fastapi.git
cd stac-fastapi
# Build docs
uvx --with-requirements requirements/requirements-docs.txt mkdocs build -f docs/mkdocs.yml
uv run --group docs mkdocs build -f docs/mkdocs.yml
```

Hot-reloading docs:

```bash
uvx --with-requirements requirements/requirements-docs.txt mkdocs serve -f docs/mkdocs.yml --livereload
uv run --group docs mkdocs serve -f docs/mkdocs.yml --livereload
```

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

```bash
# deploy
uvx --with-requirements requirements/requirements-docs.txt mkdocs gh-deploy -f docs/mkdocs.yml
uv run --group docs mkdocs gh-deploy -f docs/mkdocs.yml
```
30 changes: 11 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,16 @@
ARG PYTHON_VERSION=3.14

FROM python:${PYTHON_VERSION}-slim AS base

# Any python libraries that require system libraries to be installed will likely
# need the following packages in order to build
RUN apt-get update && \
apt-get -y upgrade && \
apt-get install -y build-essential git && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

ENV CURL_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt

FROM base AS builder
FROM ghcr.io/astral-sh/uv:python3.14-bookworm-slim

WORKDIR /app

RUN apt-get update && apt-get install -y gcc
COPY . /app

RUN python -m pip install \
-e ./stac_fastapi/types \
-e ./stac_fastapi/api \
-e ./stac_fastapi/extensions
ENV CURL_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
ENV UV_COMPILE_BYTECODE=1
ENV UV_LINK_MODE=copy
ENV UV_TOOL_BIN_DIR=/usr/local/bin
RUN --mount=type=cache,target=/root/.cache/uv \
--mount=type=bind,source=uv.lock,target=uv.lock \
uv sync --locked --no-dev

ENV PATH="/app/.venv/bin:$PATH"
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ test: install

.PHONY: docs
docs:
uvx --with-requirements requirements/requirements-docs.txt mkdocs build -f docs/mkdocs.yml
uv run --group docs mkdocs build -f docs/mkdocs.yml

.PHONY: benchmark
benchmark: install
uv run pytest stac_fastapi/api/tests/benchmarks.py --benchmark-only --benchmark-columns 'min, max, mean, median'
uv run pytest stac_fastapi/api/tests/benchmarks.py --benchmark-only --benchmark-columns 'min, max, mean, median'
25 changes: 16 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,19 @@ version = "6.0.0"
description = "Python library for building a STAC-compliant FastAPI application."
requires-python = ">=3.9"
readme = "README.md"
dependencies = []
dependencies = [
"stac-fastapi-api",
"stac-fastapi-types",
"stac-fastapi-extensions",
]

[tool.uv]
package = false

[tool.uv.sources]
stac_fastapi_types = { workspace = true }
stac_fastapi_extensions = { workspace = true }
stac_fastapi_api = { workspace = true }
stac-fastapi-types = { workspace = true }
stac-fastapi-extensions = { workspace = true }
stac-fastapi-api = { workspace = true }

[tool.uv.workspace]
members = [
Expand All @@ -29,11 +33,14 @@ dev = [
"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",
]
docs = [
"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",
]

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]
Expand Down
10 changes: 0 additions & 10 deletions requirements/requirements-docs.txt

This file was deleted.

12 changes: 5 additions & 7 deletions stac_fastapi/api/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,12 @@ dependencies = [
"stac-fastapi.types~=6.0",
]

[project.optional-dependencies]
[dependency-groups]
dev = [
"httpx",
"pytest",
"pytest-cov",
"pytest-asyncio",
]
benchmark = [
"httpx",
"pytest",
"pytest-cov",
"pytest-asyncio",
"pytest-benchmark",
]

Expand Down
4 changes: 2 additions & 2 deletions stac_fastapi/extensions/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ dependencies = [
"stac-fastapi.api~=6.0",
]

[project.optional-dependencies]
[dependency-groups]
dev = [
"pytest",
"pytest-cov",
Expand All @@ -58,4 +58,4 @@ only-include = ["stac_fastapi"]

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
build-backend = "hatchling.build"
2 changes: 1 addition & 1 deletion stac_fastapi/types/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ packages = [
{ include = "stac_fastapi.*" },
]

[project.optional-dependencies]
[dependency-groups]
dev = [
"pytest",
"pytest-cov",
Expand Down
Loading