From 2adf645a90f10d10f3570251e87f3d9e85dfdd8d Mon Sep 17 00:00:00 2001 From: jonhealy1 Date: Mon, 7 Apr 2025 14:28:46 +0800 Subject: [PATCH 1/3] update to v3.2.5 --- CHANGELOG.md | 10 ++++++++-- stac_fastapi/core/stac_fastapi/core/version.py | 2 +- stac_fastapi/elasticsearch/setup.py | 2 +- .../stac_fastapi/elasticsearch/version.py | 2 +- stac_fastapi/opensearch/setup.py | 2 +- .../opensearch/stac_fastapi/opensearch/version.py | 2 +- 6 files changed, 13 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 98c24ab3..3d58271e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,10 +8,15 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] ### Added -- Option to configure multiple Elasticsearch/OpenSearch hosts and enable `http_compress`. [#349](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/349) ### Changed +## [v3.2.5] - 2025-04-07 + +### Added + +- Option to configure multiple Elasticsearch/OpenSearch hosts and enable `http_compress`. [#349](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/349) + ## [v3.2.4] - 2025-03-14 ### Added @@ -302,7 +307,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Use genexp in execute_search and get_all_collections to return results. - Added db_to_stac serializer to item_collection method in core.py. -[Unreleased]: https://github.com/stac-utils/stac-fastapi-elasticsearch/tree/v3.2.4...main +[Unreleased]: https://github.com/stac-utils/stac-fastapi-elasticsearch/tree/v3.2.5...main +[v3.2.5]: https://github.com/stac-utils/stac-fastapi-elasticsearch/tree/v3.2.4...v3.2.5 [v3.2.4]: https://github.com/stac-utils/stac-fastapi-elasticsearch/tree/v3.2.3...v3.2.4 [v3.2.3]: https://github.com/stac-utils/stac-fastapi-elasticsearch/tree/v3.2.2...v3.2.3 [v3.2.2]: https://github.com/stac-utils/stac-fastapi-elasticsearch/tree/v3.2.1...v3.2.2 diff --git a/stac_fastapi/core/stac_fastapi/core/version.py b/stac_fastapi/core/stac_fastapi/core/version.py index dbabad95..ca97d75a 100644 --- a/stac_fastapi/core/stac_fastapi/core/version.py +++ b/stac_fastapi/core/stac_fastapi/core/version.py @@ -1,2 +1,2 @@ """library version.""" -__version__ = "3.2.4" +__version__ = "3.2.5" diff --git a/stac_fastapi/elasticsearch/setup.py b/stac_fastapi/elasticsearch/setup.py index 7cc31566..7fb82dc7 100644 --- a/stac_fastapi/elasticsearch/setup.py +++ b/stac_fastapi/elasticsearch/setup.py @@ -6,7 +6,7 @@ desc = f.read() install_requires = [ - "stac-fastapi.core==3.2.4", + "stac-fastapi.core==3.2.5", "elasticsearch[async]==8.11.0", "elasticsearch-dsl==8.11.0", "uvicorn", diff --git a/stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/version.py b/stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/version.py index dbabad95..ca97d75a 100644 --- a/stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/version.py +++ b/stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/version.py @@ -1,2 +1,2 @@ """library version.""" -__version__ = "3.2.4" +__version__ = "3.2.5" diff --git a/stac_fastapi/opensearch/setup.py b/stac_fastapi/opensearch/setup.py index 8522e456..0befa10e 100644 --- a/stac_fastapi/opensearch/setup.py +++ b/stac_fastapi/opensearch/setup.py @@ -6,7 +6,7 @@ desc = f.read() install_requires = [ - "stac-fastapi.core==3.2.4", + "stac-fastapi.core==3.2.5", "opensearch-py==2.4.2", "opensearch-py[async]==2.4.2", "uvicorn", diff --git a/stac_fastapi/opensearch/stac_fastapi/opensearch/version.py b/stac_fastapi/opensearch/stac_fastapi/opensearch/version.py index dbabad95..ca97d75a 100644 --- a/stac_fastapi/opensearch/stac_fastapi/opensearch/version.py +++ b/stac_fastapi/opensearch/stac_fastapi/opensearch/version.py @@ -1,2 +1,2 @@ """library version.""" -__version__ = "3.2.4" +__version__ = "3.2.5" From b7377d56c586f5555da886be5376e3d3578737d7 Mon Sep 17 00:00:00 2001 From: jonhealy1 Date: Mon, 7 Apr 2025 15:58:04 +0800 Subject: [PATCH 2/3] add config defaults --- .../stac_fastapi/elasticsearch/config.py | 11 +++++++++-- .../opensearch/stac_fastapi/opensearch/config.py | 11 +++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/config.py b/stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/config.py index 80ac7e6b..ebd06861 100644 --- a/stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/config.py +++ b/stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/config.py @@ -16,9 +16,16 @@ def _es_config() -> Dict[str, Any]: scheme = "https" if use_ssl else "http" # Configure the hosts parameter with the correct scheme + es_hosts = os.getenv("ES_HOST", "localhost").strip() # Default to localhost if ES_HOST is not set + es_port = os.getenv("ES_PORT", "9200") # Default to 9200 if ES_PORT is not set + + # Validate ES_HOST + if not es_hosts: + raise ValueError("ES_HOST environment variable is empty or invalid.") + hosts = [ - f"{scheme}://{host.strip()}:{os.getenv('ES_PORT')}" - for host in os.getenv("ES_HOST").split(",") + f"{scheme}://{host.strip()}:{es_port}" + for host in es_hosts.split(",") ] # Initialize the configuration dictionary diff --git a/stac_fastapi/opensearch/stac_fastapi/opensearch/config.py b/stac_fastapi/opensearch/stac_fastapi/opensearch/config.py index ac009f5c..2483d5d0 100644 --- a/stac_fastapi/opensearch/stac_fastapi/opensearch/config.py +++ b/stac_fastapi/opensearch/stac_fastapi/opensearch/config.py @@ -15,9 +15,16 @@ def _es_config() -> Dict[str, Any]: scheme = "https" if use_ssl else "http" # Configure the hosts parameter with the correct scheme + es_hosts = os.getenv("ES_HOST", "localhost").strip() # Default to localhost if ES_HOST is not set + es_port = os.getenv("ES_PORT", "9200") # Default to 9200 if ES_PORT is not set + + # Validate ES_HOST + if not es_hosts: + raise ValueError("ES_HOST environment variable is empty or invalid.") + hosts = [ - f"{scheme}://{host.strip()}:{os.getenv('ES_PORT')}" - for host in os.getenv("ES_HOST").split(",") + f"{scheme}://{host.strip()}:{es_port}" + for host in es_hosts.split(",") ] # Initialize the configuration dictionary From 8cbeb2a7c763079c564493b3829687096dc65747 Mon Sep 17 00:00:00 2001 From: jonhealy1 Date: Mon, 7 Apr 2025 16:15:51 +0800 Subject: [PATCH 3/3] format --- .pre-commit-config.yaml | 2 +- .../elasticsearch/stac_fastapi/elasticsearch/config.py | 9 ++++----- .../opensearch/stac_fastapi/opensearch/config.py | 9 ++++----- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bef7f1c2..a542b4c4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,7 +16,7 @@ repos: # E501 let black handle all line length decisions # W503 black conflicts with "line break before operator" rule # E203 black conflicts with "whitespace before ':'" rule - '--ignore=E501,W503,E203,C901' ] + '--ignore=E501,W503,E203,C901,E231' ] - repo: https://github.com/pre-commit/mirrors-mypy rev: v0.991 hooks: diff --git a/stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/config.py b/stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/config.py index ebd06861..0b1bcb5e 100644 --- a/stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/config.py +++ b/stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/config.py @@ -16,17 +16,16 @@ def _es_config() -> Dict[str, Any]: scheme = "https" if use_ssl else "http" # Configure the hosts parameter with the correct scheme - es_hosts = os.getenv("ES_HOST", "localhost").strip() # Default to localhost if ES_HOST is not set + es_hosts = os.getenv( + "ES_HOST", "localhost" + ).strip() # Default to localhost if ES_HOST is not set es_port = os.getenv("ES_PORT", "9200") # Default to 9200 if ES_PORT is not set # Validate ES_HOST if not es_hosts: raise ValueError("ES_HOST environment variable is empty or invalid.") - hosts = [ - f"{scheme}://{host.strip()}:{es_port}" - for host in es_hosts.split(",") - ] + hosts = [f"{scheme}://{host.strip()}:{es_port}" for host in es_hosts.split(",")] # Initialize the configuration dictionary config: Dict[str, Any] = { diff --git a/stac_fastapi/opensearch/stac_fastapi/opensearch/config.py b/stac_fastapi/opensearch/stac_fastapi/opensearch/config.py index 2483d5d0..01551d94 100644 --- a/stac_fastapi/opensearch/stac_fastapi/opensearch/config.py +++ b/stac_fastapi/opensearch/stac_fastapi/opensearch/config.py @@ -15,17 +15,16 @@ def _es_config() -> Dict[str, Any]: scheme = "https" if use_ssl else "http" # Configure the hosts parameter with the correct scheme - es_hosts = os.getenv("ES_HOST", "localhost").strip() # Default to localhost if ES_HOST is not set + es_hosts = os.getenv( + "ES_HOST", "localhost" + ).strip() # Default to localhost if ES_HOST is not set es_port = os.getenv("ES_PORT", "9200") # Default to 9200 if ES_PORT is not set # Validate ES_HOST if not es_hosts: raise ValueError("ES_HOST environment variable is empty or invalid.") - hosts = [ - f"{scheme}://{host.strip()}:{es_port}" - for host in es_hosts.split(",") - ] + hosts = [f"{scheme}://{host.strip()}:{es_port}" for host in es_hosts.split(",")] # Initialize the configuration dictionary config: Dict[str, Any] = {