Skip to content

Commit 900f0a2

Browse files
authored
Merge branch 'main' into fix-cors-origins
2 parents b30e73d + 8874baa commit 900f0a2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+5139
-298
lines changed

.github/workflows/cicd.yaml

Lines changed: 33 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
branches: [main]
77
workflow_dispatch:
88

9+
env:
10+
LATEST_PY_VERSION: '3.14'
11+
912
jobs:
1013
test:
1114
runs-on: ubuntu-latest
@@ -19,30 +22,27 @@ jobs:
1922
- name: Check out repository code
2023
uses: actions/checkout@v5
2124

22-
# Setup Python (faster than using Python container)
23-
- name: Setup Python
24-
uses: actions/setup-python@v6
25+
- name: Install uv
26+
uses: astral-sh/setup-uv@v7
2527
with:
26-
python-version: ${{ matrix.python }}
27-
cache: pip
28-
cache-dependency-path: setup.py
28+
version: "0.9.*"
29+
enable-cache: true
30+
python-version: ${{ matrix.python-version }}
31+
32+
- name: Install dependencies
33+
run: |
34+
uv sync
2935
3036
- name: Lint code
31-
if: ${{ matrix.python == 3.11 }}
37+
if: ${{ matrix.python-version == env.LATEST_PY_VERSION }}
3238
run: |
33-
python -m pip install pre-commit
34-
pre-commit run --all-files
39+
uv run pre-commit run --all-files
3540
3641
- name: install lib postgres
3742
uses: nyurik/action-setup-postgis@v2
3843

39-
- name: Install dependencies
40-
run: |
41-
python -m pip install --upgrade pip
42-
python -m pip install .[dev,server,validation]
43-
4444
- name: Run test suite
45-
run: python -m pytest --cov stac_fastapi.pgstac --cov-report xml --cov-report term-missing
45+
run: uv run pytest --cov stac_fastapi.pgstac --cov-report xml --cov-report term-missing
4646

4747
validate:
4848
runs-on: ubuntu-latest
@@ -69,20 +69,20 @@ jobs:
6969
- name: Check out repository code
7070
uses: actions/checkout@v5
7171

72-
- name: Setup Python
73-
uses: actions/setup-python@v6
72+
- name: Install uv
73+
uses: astral-sh/setup-uv@v7
7474
with:
75-
python-version: "3.11"
76-
cache: pip
77-
cache-dependency-path: setup.py
75+
version: "0.9.*"
76+
enable-cache: true
77+
python-version: ${{ env.LATEST_PY_VERSION }}
7878

79-
- name: Install stac-fastapi and stac-api-validator
79+
- name: Install dependencies
8080
run: |
81-
python -m pip install --upgrade pip
82-
python -m pip install .[server] stac-api-validator==0.6.5
81+
uv sync
82+
uv pip install stac-api-validator==0.6.5
8383
8484
- name: Load data and validate
85-
run: python -m stac_fastapi.pgstac.app & ./scripts/wait-for-it.sh localhost:8080 && python ./scripts/ingest_joplin.py http://localhost:8080 && ./scripts/validate http://localhost:8080
85+
run: uv run python -m stac_fastapi.pgstac.app & ./scripts/wait-for-it.sh localhost:8080 && uv run ./scripts/ingest_joplin.py http://localhost:8080 && uv run ./scripts/validate http://localhost:8080
8686
env:
8787
PGUSER: username
8888
PGPASSWORD: password
@@ -96,19 +96,16 @@ jobs:
9696
test-docs:
9797
runs-on: ubuntu-latest
9898
steps:
99-
- uses: actions/checkout@v5
99+
- name: Checkout main
100+
uses: actions/checkout@v5
100101

101-
- name: Setup Python
102-
uses: actions/setup-python@v6
102+
- name: Install uv
103+
uses: astral-sh/setup-uv@v7
103104
with:
104-
python-version: "3.11"
105-
cache: pip
106-
cache-dependency-path: setup.py
105+
version: "0.9.*"
106+
enable-cache: true
107+
python-version: ${{ env.LATEST_PY_VERSION }}
107108

108-
- name: Install with documentation dependencies
109+
- name: Test docs
109110
run: |
110-
python -m pip install --upgrade pip
111-
python -m pip install .[docs,dev,server]
112-
113-
- name: Build documentation
114-
run: mkdocs build --strict
111+
uv run --group docs mkdocs build -f docs/mkdocs.yml
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Publish docs via GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
# Rebuild website when docs have changed or code has changed
9+
- "README.md"
10+
- "docs/**"
11+
- "**.py"
12+
workflow_dispatch:
13+
14+
jobs:
15+
build:
16+
name: Deploy docs
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Checkout main
21+
uses: actions/checkout@v5
22+
23+
- name: Install uv
24+
uses: astral-sh/setup-uv@v7
25+
with:
26+
version: "0.9.*"
27+
enable-cache: true
28+
29+
- name: Deploy docs
30+
run: uv run --group docs mkdocs gh-deploy --force -f docs/mkdocs.yml

.github/workflows/pages.yml

Lines changed: 0 additions & 46 deletions
This file was deleted.

.github/workflows/publish.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,16 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- uses: actions/checkout@v5
14-
- name: Set up Python 3.x
15-
uses: actions/setup-python@v6
14+
15+
- name: Install uv
16+
uses: astral-sh/setup-uv@v7
1617
with:
17-
python-version: "3.x"
18-
- name: Install release dependencies
19-
run: |
20-
python -m pip install --upgrade pip
21-
pip install setuptools wheel twine
18+
version: "0.9.*"
19+
enable-cache: true
20+
2221
- name: Build and publish package
2322
env:
24-
TWINE_USERNAME: ${{ secrets.PYPI_STACUTILS_USERNAME }}
25-
TWINE_PASSWORD: ${{ secrets.PYPI_STACUTILS_PASSWORD }}
23+
UV_PUBLISH_USERNAME: ${{ secrets.PYPI_STACUTILS_USERNAME }}
24+
UV_PUBLISH_PASSWORD: ${{ secrets.PYPI_STACUTILS_PASSWORD }}
2625
run: |
2726
scripts/publish

CHANGES.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,26 @@
44

55
### Changed
66

7+
- Docker container runs as non-root user
8+
9+
## [6.1.0] - 2025-11-03
10+
11+
### Changed
12+
713
- update `pypgstac` version requirement to `>=0.9,<0.10`
14+
- switch to pyproject.toml for package metadata
15+
- use `uv` for project managment
16+
- add python 3.14 support
817

918
### Added
1019

1120
- lower bounds for `hydraters` requirements
1221
- `EXCLUDE_HYDRATE_MARKERS=TRUE/FALSE` (defaults to `TRUE`) to exclude `𒍟※` markers returned by PgSTAC
13-
- python `3.13` and `3.14` support
22+
- python `3.13` and `3.14` support
23+
24+
### removed
25+
26+
- aws lambda handler in `app.py`
1427

1528
### Fixed
1629

@@ -503,7 +516,8 @@ As a part of this release, this repository was extracted from the main
503516

504517
- First PyPi release!
505518

506-
[Unreleased]: <https://github.com/stac-utils/stac-fastapi-pgstac/compare/6.0.2..main>
519+
[Unreleased]: <https://github.com/stac-utils/stac-fastapi-pgstac/compare/6.1.0..main>
520+
[6.1.0]: <https://github.com/stac-utils/stac-fastapi-pgstac/compare/6.0.2..6.1.0>
507521
[6.0.2]: <https://github.com/stac-utils/stac-fastapi-pgstac/compare/6.0.1..6.0.2>
508522
[6.0.1]: <https://github.com/stac-utils/stac-fastapi-pgstac/compare/6.0.0..6.0.1>
509523
[6.0.0]: <https://github.com/stac-utils/stac-fastapi-pgstac/compare/5.0.3..6.0.0>

CONTRIBUTING.md

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
# Contributing
22

3-
Issues and pull requests are more than welcome.
3+
Use Github [Pull Requests](https://github.com/stac-utils/stac-fastapi-pgstac/pulls) to provide new features or to request review of draft code, and use [Issues](https://github.com/stac-utils/stac-fastapi-pgstac/issues) to report bugs or request new features.
44

55
## Development install
66

7-
```shell
8-
git clone https://github.com/stac-utils/stac-fastapi-pgstac
9-
cd stac-fastapi-pgstac
10-
make install
11-
```
7+
We recommand using [`uv`](https://docs.astral.sh/uv) as project manager for development.
128

13-
This repo is set to use `pre-commit` to run *isort*, *flake8*, *pydocstring*, *black* ("uncompromising Python code formatter") and mypy when committing new code.
9+
See https://docs.astral.sh/uv/getting-started/installation/ for installation
1410

15-
```shell
16-
pre-commit install
11+
**dev install**
12+
13+
```bash
14+
git clone https://github.com/stac-utils/stac-fastapi-pgstac.git
15+
cd stac-fastapi
16+
uv sync
1717
```
1818

1919
To run the service on 0.0.0.0:8082 and ingest example data into the database (the "joplin" collection):
@@ -30,26 +30,33 @@ To run the tests:
3030
make test
3131
```
3232

33-
## Docs
33+
**pre-commit**
34+
35+
This repo is set to use `pre-commit` to run *isort*, *flake8*, *pydocstring*, *black* ("uncompromising Python code formatter") and mypy when committing new code.
36+
37+
```shell
38+
pre-commit install
39+
```
40+
41+
### Docs
3442

3543
```bash
36-
git clone https://github.com/stac-utils/stac-fastapi-pgstac
44+
git clone https://github.com/stac-utils/stac-fastapi-pgstac.git
3745
cd stac-fastapi-pgstac
38-
pip install -e .[docs]
46+
# Build docs
47+
uv run --group docs mkdocs build -f docs/mkdocs.yml
3948
```
4049

4150
Hot-reloading docs:
4251

4352
```bash
44-
mkdocs serve
53+
uv run --group docs mkdocs serve -f docs/mkdocs.yml --livereload
4554
```
4655

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

50-
```shell
51-
# Create API documentations
52-
make docs
59+
```bash
5360
# deploy
54-
mkdocs gh-deploy
61+
uv run --group docs mkdocs gh-deploy -f docs/mkdocs.yml
5562
```

Dockerfile

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG PYTHON_VERSION=3.12
1+
ARG PYTHON_VERSION=3.14
22

33
FROM python:${PYTHON_VERSION}-slim AS base
44

@@ -14,10 +14,19 @@ ENV CURL_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
1414

1515
FROM base AS builder
1616

17+
RUN python -m pip install -U pip
18+
1719
WORKDIR /app
1820

19-
COPY . /app
21+
COPY stac_fastapi/ stac_fastapi/
22+
COPY pyproject.toml pyproject.toml
23+
COPY README.md README.md
24+
25+
RUN python -m pip install .[server]
26+
RUN rm -rf stac_fastapi .toml README.md
2027

21-
RUN python -m pip install -e .[server]
28+
RUN groupadd -g 1000 user && \
29+
useradd -u 1000 -g user -s /bin/bash -m user
30+
USER user
2231

2332
CMD ["uvicorn", "stac_fastapi.pgstac.app:app", "--host", "0.0.0.0", "--port", "8080"]

Dockerfile.docs

Lines changed: 0 additions & 14 deletions
This file was deleted.

Dockerfile.tests

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
ARG PYTHON_VERSION=3.12
1+
ARG PYTHON_VERSION=3.13
22

33
FROM python:${PYTHON_VERSION}-slim as base
44

55
# Any python libraries that require system libraries to be installed will likely
66
# need the following packages in order to build
77
RUN apt-get update && \
88
apt-get -y upgrade && \
9-
apt-get install -y build-essential git libpq-dev postgresql-15-postgis-3 && \
9+
apt-get install -y build-essential git libpq-dev postgresql-17-postgis-3 && \
1010
apt-get clean && \
1111
rm -rf /var/lib/apt/lists/*
1212

@@ -16,4 +16,4 @@ USER newuser
1616
WORKDIR /app
1717
COPY . /app
1818

19-
RUN python -m pip install -e .[dev,server] --user
19+
RUN python -m pip install . --user --group dev

0 commit comments

Comments
 (0)