Skip to content

Update package names for Pep625 compliance #358

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Apr 18, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
20 changes: 18 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,22 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

### Fixed

## [v4.0.0a0] - 2025-04-17
## [v4.0.0a1] - 2925-04-17

### Changed
- Updated package names in setup.py files to use underscores instead of periods for PEP 625 compliance [#358](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/358)
- Changed `stac_fastapi.opensearch` to `stac_fastapi_opensearch`
- Changed `stac_fastapi.elasticsearch` to `stac_fastapi_elasticsearch`
- Changed `stac_fastapi.core` to `stac_fastapi_core`
- Updated all related dependencies to use the new naming convention
- Renamed `docker-compose.yml` to `compose.yml` to align with Docker Compose V2 conventions [#358](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/358)
- Removed deprecated `version` field from all compose files [#358](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/358)
- Updated `STAC_FASTAPI_VERSION` environment variables to 4.0.0a1 in all compose files [#358](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/358)
- Bumped version from 4.0.0a0 to 4.0.0a1 for the PEP 625 compliant release [#358](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/358)
- Updated dependency requirements to use compatible release specifiers (~=) for more controlled updates while allowing for bug fixes and security patches [#358](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/issues/358)
- Removed elasticsearch-dsl dependency as it's now part of the elasticsearch package since version 8.18.0 [#358](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/issues/358)

## [v4.0.0a0] - 2025-04-16

### Added
- Added support for dynamically-generated queryables based on Elasticsearch/OpenSearch mappings, with extensible metadata augmentation [#351](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/351)
Expand Down Expand Up @@ -328,7 +343,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/v4.0.0a0...main
[Unreleased]: https://github.com/stac-utils/stac-fastapi-elasticsearch/tree/v4.0.0a1...main
[v4.0.0a1]: https://github.com/stac-utils/stac-fastapi-elasticsearch/tree/v4.0.0a0...v4.0.0a1
[v4.0.0a0]: https://github.com/stac-utils/stac-fastapi-elasticsearch/tree/v3.2.5...v4.0.0a0
[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
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,10 @@ install-os: pybase-install

.PHONY: docs-image
docs-image:
docker compose -f docker compose.docs.yml \
docker compose -f compose.docs.yml \
build

.PHONY: docs
docs: docs-image
docker compose -f docker compose.docs.yml \
docker compose -f compose.docs.yml \
run docs
32 changes: 19 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</p>


[![PyPI version](https://badge.fury.io/py/stac-fastapi.elasticsearch.svg)](https://badge.fury.io/py/stac-fastapi.elasticsearch)
[![PyPI version](https://badge.fury.io/py/stac-fastapi-elasticsearch.svg)](https://badge.fury.io/py/stac-fastapi-elasticsearch) [![PyPI version](https://badge.fury.io/py/stac-fastapi-opensearch.svg)](https://badge.fury.io/py/stac-fastapi-opensearch)
[![Join the chat at https://gitter.im/stac-fastapi-elasticsearch/community](https://badges.gitter.im/stac-fastapi-elasticsearch/community.svg)](https://gitter.im/stac-fastapi-elasticsearch/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)


Expand All @@ -26,7 +26,7 @@

- Our Api core library can be used to create custom backends. See [stac-fastapi-mongo](https://github.com/Healy-Hyperspatial/stac-fastapi-mongo) for a working example.
- Reach out on our [Gitter](https://app.gitter.im/#/room/#stac-fastapi-elasticsearch_community:gitter.im) channel or feel free to add to our [Discussions](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/discussions) page here on github.
- There is [Postman](https://documenter.getpostman.com/view/12888943/2s8ZDSdRHA) documentation here for examples on how to run some of the API routes locally - after starting the elasticsearch backend via the docker-compose.yml file.
- There is [Postman](https://documenter.getpostman.com/view/12888943/2s8ZDSdRHA) documentation here for examples on how to run some of the API routes locally - after starting the elasticsearch backend via the compose.yml file.
- The `/examples` folder shows an example of running stac-fastapi-elasticsearch from PyPI in docker without needing any code from the repository. There is also a Postman collection here that you can load into Postman for testing the API routes.

- For changes, see the [Changelog](CHANGELOG.md)
Expand All @@ -35,14 +35,20 @@

### To install from PyPI:

```shell
pip install stac_fastapi.elasticsearch
```
or
```
pip install stac_fastapi.opensearch
```bash
# For versions 4.0.0a1 and newer (PEP 625 compliant naming):
pip install stac-fastapi-elasticsearch # Elasticsearch backend
pip install stac-fastapi-opensearch # Opensearch backend
pip install stac-fastapi-core # Core library

# For versions 4.0.0a0 and older:
pip install stac-fastapi.elasticsearch # Elasticsearch backend
pip install stac-fastapi.opensearch # Opensearch backend
pip install stac-fastapi.core # Core library
```

> **Important Note:** Starting with version 4.0.0a1, package names have changed from using periods (e.g., `stac-fastapi.core`) to using hyphens (e.g., `stac-fastapi-core`) to comply with PEP 625. The internal package structure uses underscores, but users should install with hyphens as shown above. Please update your requirements files accordingly.

### To install and run via pre-built Docker Images

We provide ready-to-use Docker images through GitHub Container Registry ([ElasticSearch](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pkgs/container/stac-fastapi-es) and [OpenSearch](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pkgs/container/stac-fastapi-os) backends). You can easily pull and run these images:
Expand All @@ -57,15 +63,15 @@ docker pull ghcr.io/stac-utils/stac-fastapi-os:latest

## Run Elasticsearch API backend on localhost:8080

You need to ensure [**Docker Compose**](https://docs.docker.com/compose/install/) or [**Podman Compose**](https://podman-desktop.io/docs/compose) installed and running on your machine. In the follwoing command instead of `docker-compose` you can use `podman-compose` as well.
You need to ensure [**Docker Compose**](https://docs.docker.com/compose/install/) or [**Podman Compose**](https://podman-desktop.io/docs/compose) installed and running on your machine. In the following command instead of `docker compose` you can use `podman-compose` as well.

```shell
docker-compose up elasticsearch app-elasticsearch
docker compose up elasticsearch app-elasticsearch
```

By default, docker-compose uses Elasticsearch 8.x and OpenSearch 2.11.1.
By default, Docker Compose uses Elasticsearch 8.x and OpenSearch 2.11.1.
If you wish to use a different version, put the following in a
file named `.env` in the same directory you run docker-compose from:
file named `.env` in the same directory you run Docker Compose from:

```shell
ELASTICSEARCH_VERSION=7.17.1
Expand Down Expand Up @@ -165,7 +171,7 @@ These templates will be used implicitly when creating new Collection and Item in
This section covers how to create a snapshot repository and then create and restore snapshots with this.

Create a snapshot repository. This puts the files in the `elasticsearch/snapshots` in this git repo clone, as
the elasticsearch.yml and docker-compose files create a mapping from that directory to
the elasticsearch.yml and compose files create a mapping from that directory to
`/usr/share/elasticsearch/snapshots` within the Elasticsearch container and grant permissions on using it.

```shell
Expand Down
2 changes: 0 additions & 2 deletions docker-compose.docs.yml → compose.docs.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3'

services:
docs:
container_name: stac-fastapi-docs-dev
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml → compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ services:
environment:
- STAC_FASTAPI_TITLE=stac-fastapi-elasticsearch
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Elasticsearch backend
- STAC_FASTAPI_VERSION=2.1
- STAC_FASTAPI_VERSION=4.0.0a1
- APP_HOST=0.0.0.0
- APP_PORT=8080
- RELOAD=true
Expand Down Expand Up @@ -41,7 +41,7 @@ services:
environment:
- STAC_FASTAPI_TITLE=stac-fastapi-opensearch
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Opensearch backend
- STAC_FASTAPI_VERSION=3.0.0a2
- STAC_FASTAPI_VERSION=4.0.0a1
- APP_HOST=0.0.0.0
- APP_PORT=8082
- RELOAD=true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3.9'

services:
app-elasticsearch:
container_name: stac-fastapi-es
Expand All @@ -11,7 +9,7 @@ services:
environment:
- STAC_FASTAPI_TITLE=stac-fastapi-elasticsearch
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Elasticsearch backend
- STAC_FASTAPI_VERSION=3.0.0a2
- STAC_FASTAPI_VERSION=4.0.0a1
- APP_HOST=0.0.0.0
- APP_PORT=8080
- RELOAD=true
Expand Down Expand Up @@ -44,7 +42,7 @@ services:
environment:
- STAC_FASTAPI_TITLE=stac-fastapi-opensearch
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Opensearch backend
- STAC_FASTAPI_VERSION=2.1
- STAC_FASTAPI_VERSION=4.0.0a1
- APP_HOST=0.0.0.0
- APP_PORT=8082
- RELOAD=true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3.9'

services:
app-elasticsearch:
container_name: stac-fastapi-es
Expand All @@ -11,7 +9,7 @@ services:
environment:
- STAC_FASTAPI_TITLE=stac-fastapi-elasticsearch
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Elasticsearch backend
- STAC_FASTAPI_VERSION=3.0.0a1
- STAC_FASTAPI_VERSION=4.0.0a1
- APP_HOST=0.0.0.0
- APP_PORT=8080
- RELOAD=true
Expand Down Expand Up @@ -45,7 +43,7 @@ services:
environment:
- STAC_FASTAPI_TITLE=stac-fastapi-opensearch
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Opensearch backend
- STAC_FASTAPI_VERSION=2.1
- STAC_FASTAPI_VERSION=4.0.0a1
- APP_HOST=0.0.0.0
- APP_PORT=8082
- RELOAD=true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3.9'

services:
app-elasticsearch:
container_name: stac-fastapi-es
Expand All @@ -11,7 +9,7 @@ services:
environment:
- STAC_FASTAPI_TITLE=stac-fastapi-elasticsearch
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Elasticsearch backend
- STAC_FASTAPI_VERSION=3.0.0a2
- STAC_FASTAPI_VERSION=4.0.0a1
- APP_HOST=0.0.0.0
- APP_PORT=8080
- RELOAD=true
Expand Down Expand Up @@ -44,7 +42,7 @@ services:
environment:
- STAC_FASTAPI_TITLE=stac-fastapi-opensearch
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Opensearch backend
- STAC_FASTAPI_VERSION=2.1
- STAC_FASTAPI_VERSION=4.0.0a1
- APP_HOST=0.0.0.0
- APP_PORT=8082
- RELOAD=true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3'

services:
app-elasticsearch:
container_name: stac-fastapi-es
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3.9'

services:
app-elasticsearch:
container_name: stac-fastapi-es
Expand All @@ -11,7 +9,7 @@ services:
environment:
- STAC_FASTAPI_TITLE=stac-fastapi-elasticsearch
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Elasticsearch backend
- STAC_FASTAPI_VERSION=2.1
- STAC_FASTAPI_VERSION=4.0.0a1
- APP_HOST=0.0.0.0
- APP_PORT=8080
- RELOAD=true
Expand Down Expand Up @@ -44,7 +42,7 @@ services:
environment:
- STAC_FASTAPI_TITLE=stac-fastapi-opensearch
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Opensearch backend
- STAC_FASTAPI_VERSION=3.0.0a2
- STAC_FASTAPI_VERSION=4.0.0a1
- APP_HOST=0.0.0.0
- APP_PORT=8082
- RELOAD=true
Expand Down
23 changes: 11 additions & 12 deletions stac_fastapi/core/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,31 @@
desc = f.read()

install_requires = [
"fastapi",
"fastapi~=0.109.0",
"attrs>=23.2.0",
"pydantic",
"stac_pydantic==3.1.*",
"pydantic>=2.4.1,<3.0.0",
"stac_pydantic~=3.1.0",
"stac-fastapi.api==5.1.1",
"stac-fastapi.extensions==5.1.1",
"stac-fastapi.types==5.1.1",
"orjson",
"overrides",
"geojson-pydantic",
"pygeofilter==0.3.1",
"jsonschema",
"slowapi==0.1.9",
"orjson~=3.9.0",
"overrides~=7.4.0",
"geojson-pydantic~=1.0.0",
"pygeofilter~=0.3.1",
"jsonschema~=4.0.0",
"slowapi~=0.1.9",
]

setup(
name="stac_fastapi.core",
name="stac_fastapi_core",
description="Core library for the Elasticsearch and Opensearch stac-fastapi backends.",
long_description=desc,
long_description_content_type="text/markdown",
python_requires=">=3.8",
python_requires=">=3.9",
classifiers=[
"Intended Audience :: Developers",
"Intended Audience :: Information Technology",
"Intended Audience :: Science/Research",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
Expand Down
2 changes: 1 addition & 1 deletion stac_fastapi/core/stac_fastapi/core/version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
"""library version."""
__version__ = "4.0.0a0"
__version__ = "4.0.0a1"
32 changes: 15 additions & 17 deletions stac_fastapi/elasticsearch/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,38 +6,36 @@
desc = f.read()

install_requires = [
"stac-fastapi.core==4.0.0a0",
"elasticsearch[async]==8.11.0",
"elasticsearch-dsl==8.11.0",
"uvicorn",
"starlette",
"stac-fastapi-core==4.0.0a1",
"elasticsearch[async]~=8.18.0",
"uvicorn~=0.23.0",
"starlette>=0.35.0,<0.36.0",
]

extra_reqs = {
"dev": [
"pytest",
"pytest-cov",
"pytest-asyncio",
"pre-commit",
"requests",
"ciso8601",
"httpx<=0.27.2",
"pytest~=7.0.0",
"pytest-cov~=4.0.0",
"pytest-asyncio~=0.21.0",
"pre-commit~=3.0.0",
"requests>=2.32.0,<3.0.0",
"ciso8601~=2.3.0",
"httpx>=0.24.0,<0.28.0",
],
"docs": ["mkdocs", "mkdocs-material", "pdocs"],
"server": ["uvicorn[standard]==0.19.0"],
"docs": ["mkdocs~=1.4.0", "mkdocs-material~=9.0.0", "pdocs~=1.2.0"],
"server": ["uvicorn[standard]~=0.23.0"],
}

setup(
name="stac_fastapi.elasticsearch",
name="stac_fastapi_elasticsearch",
description="An implementation of STAC API based on the FastAPI framework with both Elasticsearch and Opensearch.",
long_description=desc,
long_description_content_type="text/markdown",
python_requires=">=3.8",
python_requires=">=3.9",
classifiers=[
"Intended Audience :: Developers",
"Intended Audience :: Information Technology",
"Intended Audience :: Science/Research",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def _es_config() -> Dict[str, Any]:
# Initialize the configuration dictionary
config: Dict[str, Any] = {
"hosts": hosts,
"headers": {"accept": "application/vnd.elasticsearch+json; compatible-with=7"},
"headers": {"accept": "application/vnd.elasticsearch+json; compatible-with=8"},
}

# Handle API key
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from typing import Any, Dict, Iterable, List, Optional, Tuple, Type

import attr
from elasticsearch_dsl import Q, Search
from elasticsearch.dsl import Q, Search
from starlette.requests import Request

from elasticsearch import exceptions, helpers # type: ignore
Expand Down Expand Up @@ -232,7 +232,7 @@ async def get_all_collections(
body={
"sort": [{"id": {"order": "asc"}}],
"size": limit,
"search_after": search_after,
**({"search_after": search_after} if search_after is not None else {}),
},
)

Expand Down Expand Up @@ -497,7 +497,7 @@ async def execute_search(
ignore_unavailable=ignore_unavailable,
query=query,
sort=sort or DEFAULT_SORT,
search_after=search_after,
**({"search_after": search_after} if search_after is not None else {}),
size=size_limit,
)
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
"""library version."""
__version__ = "4.0.0a0"
__version__ = "4.0.0a1"
Loading