Skip to content

Commit 5f91e50

Browse files
authored
Update package names for Pep625 compliance (#358)
**Related Issue(s):** #337 **Description:** - Updated package names in setup.py files to use underscores instead of periods for PEP 625 compliance - 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 - Removed deprecated `version` field from all compose files - Updated `STAC_FASTAPI_VERSION` environment variables to 4.0.0a1 in all compose files - Bumped version from 4.0.0a0 to 4.0.0a1 for the PEP 625 compliant release - Updated dependency requirements to use compatible release specifiers (~=) for more controlled updates while allowing for bug fixes and security patches - Removed elasticsearch-dsl dependency as it's now part of the elasticsearch package since version 8.18.0 **PR Checklist:** - [x] Code is formatted and linted (run `pre-commit run --all-files`) - [x] Tests pass (run `make test`) - [x] Documentation has been updated to reflect changes, if applicable - [x] Changes are added to the changelog
1 parent 790fb7d commit 5f91e50

File tree

18 files changed

+98
-92
lines changed

18 files changed

+98
-92
lines changed

CHANGELOG.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,22 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1313

1414
### Fixed
1515

16-
## [v4.0.0a0] - 2025-04-17
16+
## [v4.0.0a1] - 2925-04-17
17+
18+
### Changed
19+
- 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)
20+
- Changed `stac_fastapi.opensearch` to `stac_fastapi_opensearch`
21+
- Changed `stac_fastapi.elasticsearch` to `stac_fastapi_elasticsearch`
22+
- Changed `stac_fastapi.core` to `stac_fastapi_core`
23+
- Updated all related dependencies to use the new naming convention
24+
- 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)
25+
- Removed deprecated `version` field from all compose files [#358](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/358)
26+
- 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)
27+
- 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)
28+
- 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)
29+
- 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)
30+
31+
## [v4.0.0a0] - 2025-04-16
1732

1833
### Added
1934
- 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)
@@ -328,7 +343,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
328343
- Use genexp in execute_search and get_all_collections to return results.
329344
- Added db_to_stac serializer to item_collection method in core.py.
330345

331-
[Unreleased]: https://github.com/stac-utils/stac-fastapi-elasticsearch/tree/v4.0.0a0...main
346+
[Unreleased]: https://github.com/stac-utils/stac-fastapi-elasticsearch/tree/v4.0.0a1...main
347+
[v4.0.0a1]: https://github.com/stac-utils/stac-fastapi-elasticsearch/tree/v4.0.0a0...v4.0.0a1
332348
[v4.0.0a0]: https://github.com/stac-utils/stac-fastapi-elasticsearch/tree/v3.2.5...v4.0.0a0
333349
[v3.2.5]: https://github.com/stac-utils/stac-fastapi-elasticsearch/tree/v3.2.4...v3.2.5
334350
[v3.2.4]: https://github.com/stac-utils/stac-fastapi-elasticsearch/tree/v3.2.3...v3.2.4

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,10 @@ install-os: pybase-install
107107

108108
.PHONY: docs-image
109109
docs-image:
110-
docker compose -f docker compose.docs.yml \
110+
docker compose -f compose.docs.yml \
111111
build
112112

113113
.PHONY: docs
114114
docs: docs-image
115-
docker compose -f docker compose.docs.yml \
115+
docker compose -f compose.docs.yml \
116116
run docs

README.md

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</p>
1010

1111

12-
[![PyPI version](https://badge.fury.io/py/stac-fastapi.elasticsearch.svg)](https://badge.fury.io/py/stac-fastapi.elasticsearch)
12+
[![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)
1313
[![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)
1414

1515

@@ -26,7 +26,7 @@
2626

2727
- 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.
2828
- 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.
29-
- 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.
29+
- 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.
3030
- 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.
3131

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

3636
### To install from PyPI:
3737

38-
```shell
39-
pip install stac_fastapi.elasticsearch
40-
```
41-
or
42-
```
43-
pip install stac_fastapi.opensearch
38+
```bash
39+
# For versions 4.0.0a1 and newer (PEP 625 compliant naming):
40+
pip install stac-fastapi-elasticsearch # Elasticsearch backend
41+
pip install stac-fastapi-opensearch # Opensearch backend
42+
pip install stac-fastapi-core # Core library
43+
44+
# For versions 4.0.0a0 and older:
45+
pip install stac-fastapi.elasticsearch # Elasticsearch backend
46+
pip install stac-fastapi.opensearch # Opensearch backend
47+
pip install stac-fastapi.core # Core library
4448
```
4549

50+
> **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.
51+
4652
### To install and run via pre-built Docker Images
4753

4854
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:
@@ -57,15 +63,15 @@ docker pull ghcr.io/stac-utils/stac-fastapi-os:latest
5763

5864
## Run Elasticsearch API backend on localhost:8080
5965

60-
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.
66+
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.
6167

6268
```shell
63-
docker-compose up elasticsearch app-elasticsearch
69+
docker compose up elasticsearch app-elasticsearch
6470
```
6571

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

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

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

171177
```shell

docker-compose.docs.yml renamed to compose.docs.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: '3'
2-
31
services:
42
docs:
53
container_name: stac-fastapi-docs-dev

docker-compose.yml renamed to compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ services:
99
environment:
1010
- STAC_FASTAPI_TITLE=stac-fastapi-elasticsearch
1111
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Elasticsearch backend
12-
- STAC_FASTAPI_VERSION=2.1
12+
- STAC_FASTAPI_VERSION=4.0.0a1
1313
- APP_HOST=0.0.0.0
1414
- APP_PORT=8080
1515
- RELOAD=true
@@ -41,7 +41,7 @@ services:
4141
environment:
4242
- STAC_FASTAPI_TITLE=stac-fastapi-opensearch
4343
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Opensearch backend
44-
- STAC_FASTAPI_VERSION=3.0.0a2
44+
- STAC_FASTAPI_VERSION=4.0.0a1
4545
- APP_HOST=0.0.0.0
4646
- APP_PORT=8082
4747
- RELOAD=true

examples/auth/docker-compose.basic_auth.yml renamed to examples/auth/compose.basic_auth.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: '3.9'
2-
31
services:
42
app-elasticsearch:
53
container_name: stac-fastapi-es
@@ -11,7 +9,7 @@ services:
119
environment:
1210
- STAC_FASTAPI_TITLE=stac-fastapi-elasticsearch
1311
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Elasticsearch backend
14-
- STAC_FASTAPI_VERSION=3.0.0a2
12+
- STAC_FASTAPI_VERSION=4.0.0a1
1513
- APP_HOST=0.0.0.0
1614
- APP_PORT=8080
1715
- RELOAD=true
@@ -44,7 +42,7 @@ services:
4442
environment:
4543
- STAC_FASTAPI_TITLE=stac-fastapi-opensearch
4644
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Opensearch backend
47-
- STAC_FASTAPI_VERSION=2.1
45+
- STAC_FASTAPI_VERSION=4.0.0a1
4846
- APP_HOST=0.0.0.0
4947
- APP_PORT=8082
5048
- RELOAD=true

examples/auth/docker-compose.oauth2.yml renamed to examples/auth/compose.oauth2.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: '3.9'
2-
31
services:
42
app-elasticsearch:
53
container_name: stac-fastapi-es
@@ -11,7 +9,7 @@ services:
119
environment:
1210
- STAC_FASTAPI_TITLE=stac-fastapi-elasticsearch
1311
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Elasticsearch backend
14-
- STAC_FASTAPI_VERSION=3.0.0a1
12+
- STAC_FASTAPI_VERSION=4.0.0a1
1513
- APP_HOST=0.0.0.0
1614
- APP_PORT=8080
1715
- RELOAD=true
@@ -45,7 +43,7 @@ services:
4543
environment:
4644
- STAC_FASTAPI_TITLE=stac-fastapi-opensearch
4745
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Opensearch backend
48-
- STAC_FASTAPI_VERSION=2.1
46+
- STAC_FASTAPI_VERSION=4.0.0a1
4947
- APP_HOST=0.0.0.0
5048
- APP_PORT=8082
5149
- RELOAD=true

examples/auth/docker-compose.route_dependencies.yml renamed to examples/auth/compose.route_dependencies.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: '3.9'
2-
31
services:
42
app-elasticsearch:
53
container_name: stac-fastapi-es
@@ -11,7 +9,7 @@ services:
119
environment:
1210
- STAC_FASTAPI_TITLE=stac-fastapi-elasticsearch
1311
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Elasticsearch backend
14-
- STAC_FASTAPI_VERSION=3.0.0a2
12+
- STAC_FASTAPI_VERSION=4.0.0a1
1513
- APP_HOST=0.0.0.0
1614
- APP_PORT=8080
1715
- RELOAD=true
@@ -44,7 +42,7 @@ services:
4442
environment:
4543
- STAC_FASTAPI_TITLE=stac-fastapi-opensearch
4644
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Opensearch backend
47-
- STAC_FASTAPI_VERSION=2.1
45+
- STAC_FASTAPI_VERSION=4.0.0a1
4846
- APP_HOST=0.0.0.0
4947
- APP_PORT=8082
5048
- RELOAD=true

examples/pip_docker/docker-compose.yml renamed to examples/pip_docker/compose.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: '3'
2-
31
services:
42
app-elasticsearch:
53
container_name: stac-fastapi-es

examples/rate_limit/docker-compose.rate_limit.yml renamed to examples/rate_limit/compose.rate_limit.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: '3.9'
2-
31
services:
42
app-elasticsearch:
53
container_name: stac-fastapi-es
@@ -11,7 +9,7 @@ services:
119
environment:
1210
- STAC_FASTAPI_TITLE=stac-fastapi-elasticsearch
1311
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Elasticsearch backend
14-
- STAC_FASTAPI_VERSION=2.1
12+
- STAC_FASTAPI_VERSION=4.0.0a1
1513
- APP_HOST=0.0.0.0
1614
- APP_PORT=8080
1715
- RELOAD=true
@@ -44,7 +42,7 @@ services:
4442
environment:
4543
- STAC_FASTAPI_TITLE=stac-fastapi-opensearch
4644
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Opensearch backend
47-
- STAC_FASTAPI_VERSION=3.0.0a2
45+
- STAC_FASTAPI_VERSION=4.0.0a1
4846
- APP_HOST=0.0.0.0
4947
- APP_PORT=8082
5048
- RELOAD=true

stac_fastapi/core/setup.py

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,32 +6,31 @@
66
desc = f.read()
77

88
install_requires = [
9-
"fastapi",
9+
"fastapi~=0.109.0",
1010
"attrs>=23.2.0",
11-
"pydantic",
12-
"stac_pydantic==3.1.*",
11+
"pydantic>=2.4.1,<3.0.0",
12+
"stac_pydantic~=3.1.0",
1313
"stac-fastapi.api==5.1.1",
1414
"stac-fastapi.extensions==5.1.1",
1515
"stac-fastapi.types==5.1.1",
16-
"orjson",
17-
"overrides",
18-
"geojson-pydantic",
19-
"pygeofilter==0.3.1",
20-
"jsonschema",
21-
"slowapi==0.1.9",
16+
"orjson~=3.9.0",
17+
"overrides~=7.4.0",
18+
"geojson-pydantic~=1.0.0",
19+
"pygeofilter~=0.3.1",
20+
"jsonschema~=4.0.0",
21+
"slowapi~=0.1.9",
2222
]
2323

2424
setup(
25-
name="stac_fastapi.core",
25+
name="stac_fastapi_core",
2626
description="Core library for the Elasticsearch and Opensearch stac-fastapi backends.",
2727
long_description=desc,
2828
long_description_content_type="text/markdown",
29-
python_requires=">=3.8",
29+
python_requires=">=3.9",
3030
classifiers=[
3131
"Intended Audience :: Developers",
3232
"Intended Audience :: Information Technology",
3333
"Intended Audience :: Science/Research",
34-
"Programming Language :: Python :: 3.8",
3534
"Programming Language :: Python :: 3.9",
3635
"Programming Language :: Python :: 3.10",
3736
"Programming Language :: Python :: 3.11",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
"""library version."""
2-
__version__ = "4.0.0a0"
2+
__version__ = "4.0.0a1"

stac_fastapi/elasticsearch/setup.py

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,38 +6,36 @@
66
desc = f.read()
77

88
install_requires = [
9-
"stac-fastapi.core==4.0.0a0",
10-
"elasticsearch[async]==8.11.0",
11-
"elasticsearch-dsl==8.11.0",
12-
"uvicorn",
13-
"starlette",
9+
"stac-fastapi-core==4.0.0a1",
10+
"elasticsearch[async]~=8.18.0",
11+
"uvicorn~=0.23.0",
12+
"starlette>=0.35.0,<0.36.0",
1413
]
1514

1615
extra_reqs = {
1716
"dev": [
18-
"pytest",
19-
"pytest-cov",
20-
"pytest-asyncio",
21-
"pre-commit",
22-
"requests",
23-
"ciso8601",
24-
"httpx<=0.27.2",
17+
"pytest~=7.0.0",
18+
"pytest-cov~=4.0.0",
19+
"pytest-asyncio~=0.21.0",
20+
"pre-commit~=3.0.0",
21+
"requests>=2.32.0,<3.0.0",
22+
"ciso8601~=2.3.0",
23+
"httpx>=0.24.0,<0.28.0",
2524
],
26-
"docs": ["mkdocs", "mkdocs-material", "pdocs"],
27-
"server": ["uvicorn[standard]==0.19.0"],
25+
"docs": ["mkdocs~=1.4.0", "mkdocs-material~=9.0.0", "pdocs~=1.2.0"],
26+
"server": ["uvicorn[standard]~=0.23.0"],
2827
}
2928

3029
setup(
31-
name="stac_fastapi.elasticsearch",
30+
name="stac_fastapi_elasticsearch",
3231
description="An implementation of STAC API based on the FastAPI framework with both Elasticsearch and Opensearch.",
3332
long_description=desc,
3433
long_description_content_type="text/markdown",
35-
python_requires=">=3.8",
34+
python_requires=">=3.9",
3635
classifiers=[
3736
"Intended Audience :: Developers",
3837
"Intended Audience :: Information Technology",
3938
"Intended Audience :: Science/Research",
40-
"Programming Language :: Python :: 3.8",
4139
"Programming Language :: Python :: 3.9",
4240
"Programming Language :: Python :: 3.10",
4341
"Programming Language :: Python :: 3.11",

stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def _es_config() -> Dict[str, Any]:
3131
# Initialize the configuration dictionary
3232
config: Dict[str, Any] = {
3333
"hosts": hosts,
34-
"headers": {"accept": "application/vnd.elasticsearch+json; compatible-with=7"},
34+
"headers": {"accept": "application/vnd.elasticsearch+json; compatible-with=8"},
3535
}
3636

3737
# Handle API key

stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/database_logic.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from typing import Any, Dict, Iterable, List, Optional, Tuple, Type
99

1010
import attr
11-
from elasticsearch_dsl import Q, Search
11+
from elasticsearch.dsl import Q, Search
1212
from starlette.requests import Request
1313

1414
from elasticsearch import exceptions, helpers # type: ignore
@@ -232,7 +232,7 @@ async def get_all_collections(
232232
body={
233233
"sort": [{"id": {"order": "asc"}}],
234234
"size": limit,
235-
"search_after": search_after,
235+
**({"search_after": search_after} if search_after is not None else {}),
236236
},
237237
)
238238

@@ -497,7 +497,7 @@ async def execute_search(
497497
ignore_unavailable=ignore_unavailable,
498498
query=query,
499499
sort=sort or DEFAULT_SORT,
500-
search_after=search_after,
500+
**({"search_after": search_after} if search_after is not None else {}),
501501
size=size_limit,
502502
)
503503
)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
"""library version."""
2-
__version__ = "4.0.0a0"
2+
__version__ = "4.0.0a1"

0 commit comments

Comments
 (0)