Skip to content

Commit 4d067fb

Browse files
committed
Merge branch 'main' of github.com:stac-utils/stac-fastapi-elasticsearch into unique_asset_names
2 parents 2d69d91 + 7f269e4 commit 4d067fb

File tree

107 files changed

+10495
-3623
lines changed

Some content is hidden

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

107 files changed

+10495
-3623
lines changed

.github/workflows/cicd.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ jobs:
2828
xpack.security.enabled: false
2929
xpack.security.transport.ssl.enabled: false
3030
ES_JAVA_OPTS: -Xms512m -Xmx1g
31+
action.destructive_requires_name: false
3132
ports:
3233
- 9200:9200
3334

@@ -44,6 +45,7 @@ jobs:
4445
xpack.security.enabled: false
4546
xpack.security.transport.ssl.enabled: false
4647
ES_JAVA_OPTS: -Xms512m -Xmx1g
48+
action.destructive_requires_name: false
4749
ports:
4850
- 9400:9400
4951

@@ -60,12 +62,13 @@ jobs:
6062
plugins.security.disabled: true
6163
plugins.security.ssl.http.enabled: true
6264
OPENSEARCH_JAVA_OPTS: -Xms512m -Xmx512m
65+
action.destructive_requires_name: false
6366
ports:
6467
- 9202:9202
6568

6669
strategy:
6770
matrix:
68-
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
71+
python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13"]
6972
backend: [ "elasticsearch7", "elasticsearch8", "opensearch"]
7073

7174
name: Python ${{ matrix.python-version }} testing with ${{ matrix.backend }}
@@ -96,6 +99,10 @@ jobs:
9699
run: |
97100
pip install ./stac_fastapi/core
98101
102+
- name: Install helpers library stac-fastapi
103+
run: |
104+
pip install ./stac_fastapi/sfeos_helpers
105+
99106
- name: Install elasticsearch stac-fastapi
100107
run: |
101108
pip install ./stac_fastapi/elasticsearch[dev,server]
@@ -116,5 +123,6 @@ jobs:
116123
ES_PORT: ${{ matrix.backend == 'elasticsearch7' && '9400' || matrix.backend == 'elasticsearch8' && '9200' || '9202' }}
117124
ES_HOST: 172.17.0.1
118125
ES_USE_SSL: false
126+
DATABASE_REFRESH: true
119127
ES_VERIFY_CERTS: false
120128
BACKEND: ${{ matrix.backend == 'elasticsearch7' && 'elasticsearch' || matrix.backend == 'elasticsearch8' && 'elasticsearch' || 'opensearch' }}

.github/workflows/deploy_mkdocs.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,17 @@ jobs:
2020
- name: Checkout main
2121
uses: actions/checkout@v4
2222

23-
- name: Set up Python 3.8
23+
- name: Set up Python 3.9
2424
uses: actions/setup-python@v5
2525
with:
26-
python-version: 3.8
26+
python-version: 3.9
2727

2828
- name: Install dependencies
2929
run: |
3030
python -m pip install --upgrade pip
3131
python -m pip install \
3232
stac_fastapi/core \
33+
stac_fastapi/sfeos_helpers \
3334
stac_fastapi/elasticsearch[docs] \
3435
stac_fastapi/opensearch \
3536

.github/workflows/publish.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,18 @@ jobs:
3535
# Publish to PyPI
3636
twine upload dist/*
3737
38+
- name: Build and publish sfeos_helpers
39+
working-directory: stac_fastapi/sfeos_helpers
40+
env:
41+
TWINE_USERNAME: "__token__"
42+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
43+
run: |
44+
# Build package
45+
python setup.py sdist bdist_wheel
46+
47+
# Publish to PyPI
48+
twine upload dist/*
49+
3850
- name: Build and publish stac-fastapi-elasticsearch
3951
working-directory: stac_fastapi/elasticsearch
4052
env:

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ repos:
1616
# E501 let black handle all line length decisions
1717
# W503 black conflicts with "line break before operator" rule
1818
# E203 black conflicts with "whitespace before ':'" rule
19-
'--ignore=E501,W503,E203,C901' ]
19+
'--ignore=E501,W503,E203,C901,E231' ]
2020
- repo: https://github.com/pre-commit/mirrors-mypy
2121
rev: v0.991
2222
hooks:

CHANGELOG.md

Lines changed: 219 additions & 19 deletions
Large diffs are not rendered by default.

Makefile

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,20 @@ APP_HOST ?= 0.0.0.0
33
EXTERNAL_APP_PORT ?= 8080
44

55
ES_APP_PORT ?= 8080
6+
OS_APP_PORT ?= 8082
7+
68
ES_HOST ?= docker.for.mac.localhost
79
ES_PORT ?= 9200
810

9-
OS_APP_PORT ?= 8082
10-
OS_HOST ?= docker.for.mac.localhost
11-
OS_PORT ?= 9202
12-
13-
run_es = docker-compose \
11+
run_es = docker compose \
1412
run \
1513
-p ${EXTERNAL_APP_PORT}:${ES_APP_PORT} \
1614
-e PY_IGNORE_IMPORTMISMATCH=1 \
1715
-e APP_HOST=${APP_HOST} \
1816
-e APP_PORT=${ES_APP_PORT} \
1917
app-elasticsearch
2018

21-
run_os = docker-compose \
19+
run_os = docker compose \
2220
run \
2321
-p ${EXTERNAL_APP_PORT}:${OS_APP_PORT} \
2422
-e PY_IGNORE_IMPORTMISMATCH=1 \
@@ -29,7 +27,7 @@ run_os = docker-compose \
2927
.PHONY: image-deploy-es
3028
image-deploy-es:
3129
docker build -f dockerfiles/Dockerfile.dev.es -t stac-fastapi-elasticsearch:latest .
32-
30+
3331
.PHONY: image-deploy-os
3432
image-deploy-os:
3533
docker build -f dockerfiles/Dockerfile.dev.os -t stac-fastapi-opensearch:latest .
@@ -45,7 +43,7 @@ run-deploy-locally:
4543

4644
.PHONY: image-dev
4745
image-dev:
48-
docker-compose build
46+
docker compose build
4947

5048
.PHONY: docker-run-es
5149
docker-run-es: image-dev
@@ -66,36 +64,42 @@ docker-shell-os:
6664
.PHONY: test-elasticsearch
6765
test-elasticsearch:
6866
-$(run_es) /bin/bash -c 'export && ./scripts/wait-for-it-es.sh elasticsearch:9200 && cd stac_fastapi/tests/ && pytest'
69-
docker-compose down
67+
docker compose down
7068

7169
.PHONY: test-opensearch
7270
test-opensearch:
7371
-$(run_os) /bin/bash -c 'export && ./scripts/wait-for-it-es.sh opensearch:9202 && cd stac_fastapi/tests/ && pytest'
74-
docker-compose down
72+
docker compose down
7573

76-
.PHONY: test
77-
test:
78-
-$(run_es) /bin/bash -c 'export && ./scripts/wait-for-it-es.sh elasticsearch:9200 && cd stac_fastapi/tests/ && pytest'
79-
docker-compose down
74+
.PHONY: test-datetime-filtering-es
75+
test-datetime-filtering-es:
76+
-$(run_es) /bin/bash -c 'export ENABLE_DATETIME_INDEX_FILTERING=true && ./scripts/wait-for-it-es.sh elasticsearch:9200 && cd stac_fastapi/tests/ && pytest -s --cov=stac_fastapi --cov-report=term-missing -m datetime_filtering'
77+
docker compose down
8078

81-
-$(run_os) /bin/bash -c 'export && ./scripts/wait-for-it-es.sh opensearch:9202 && cd stac_fastapi/tests/ && pytest'
82-
docker-compose down
79+
.PHONY: test-datetime-filtering-os
80+
test-datetime-filtering-os:
81+
-$(run_os) /bin/bash -c 'export ENABLE_DATETIME_INDEX_FILTERING=true && ./scripts/wait-for-it-es.sh opensearch:9202 && cd stac_fastapi/tests/ && pytest -s --cov=stac_fastapi --cov-report=term-missing -m datetime_filtering'
82+
docker compose down
83+
84+
.PHONY: test
85+
test: test-elasticsearch test-datetime-filtering-es test-opensearch test-datetime-filtering-os
8386

8487
.PHONY: run-database-es
8588
run-database-es:
86-
docker-compose run --rm elasticsearch
89+
docker compose run --rm elasticsearch
8790

8891
.PHONY: run-database-os
8992
run-database-os:
90-
docker-compose run --rm opensearch
93+
docker compose run --rm opensearch
9194

9295
.PHONY: pybase-install
9396
pybase-install:
9497
pip install wheel && \
9598
pip install -e ./stac_fastapi/api[dev] && \
9699
pip install -e ./stac_fastapi/types[dev] && \
97100
pip install -e ./stac_fastapi/extensions[dev] && \
98-
pip install -e ./stac_fastapi/core
101+
pip install -e ./stac_fastapi/core && \
102+
pip install -e ./stac_fastapi/sfeos_helpers
99103

100104
.PHONY: install-es
101105
install-es: pybase-install
@@ -107,10 +111,10 @@ install-os: pybase-install
107111

108112
.PHONY: docs-image
109113
docs-image:
110-
docker-compose -f docker-compose.docs.yml \
114+
docker compose -f compose.docs.yml \
111115
build
112116

113117
.PHONY: docs
114118
docs: docs-image
115-
docker-compose -f docker-compose.docs.yml \
119+
docker compose -f compose.docs.yml \
116120
run docs

0 commit comments

Comments
 (0)