Skip to content

Commit f888b2d

Browse files
authored
Deprecate client (#108)
* Deprecate client * Remove more instances of README.rst
1 parent cdd53c1 commit f888b2d

File tree

7 files changed

+69
-114
lines changed

7 files changed

+69
-114
lines changed

.github/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ FROM python:${PYTHON_VERSION}
44
WORKDIR /code/elasticsearch-serverless-python
55
RUN mkdir -p /code/elasticsearch-serverless-python/build
66

7-
COPY pyproject.toml README.rst .
7+
COPY pyproject.toml README.md .
88
RUN python -m pip install \
99
-U --no-cache-dir \
1010
--disable-pip-version-check \

.github/workflows/tests.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,8 @@ jobs:
3434

3535
- name: "Check packages"
3636
run: |
37-
python -m pip install -U pip setuptools wheel build twine rstcheck
37+
python -m pip install -U pip setuptools wheel build twine
3838
python -m build
39-
# Our Python example shows a REPL and is not valid Python
40-
rstcheck --ignore-languages python README.rst
4139
python -m twine check dist/*
4240
4341
docs:

README.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Elasticsearch Serverless Python Client
2+
3+
<p align="center">
4+
<a href="https://pypi.org/project/elasticsearch"><img alt="PyPI Version" src="https://img.shields.io/pypi/v/elasticsearch" /></a>
5+
<a href="https://pypi.org/project/elasticsearch"><img alt="Python Versions" src="https://img.shields.io/pypi/pyversions/elasticsearch" /></a>
6+
<a href="https://pepy.tech/project/elasticsearch?versions=*"><img alt="Downloads" src="https://static.pepy.tech/badge/elasticsearch" /></a>
7+
<a href="https://elasticsearch-py.readthedocs.io"><img alt="Documentation Status" src="https://readthedocs.org/projects/elasticsearch-py/badge/?version=latest" /></a>
8+
</p>
9+
10+
> [!WARNING]
11+
> Starting with the release of the Elastic Stack 9.0.0, this client will be discontinued. Instead, you can use the latest version of the [Elasticsearch Python Client](https://github.com/elastic/elasticsearch-py) to build your Elasticsearch Serverless Python applications.
12+
13+
## Features
14+
15+
* Translating basic Python data types to and from JSON
16+
* Configurable automatic discovery of cluster nodes
17+
* Persistent connections
18+
* Load balancing (with pluggable selection strategy) across available nodes
19+
* Failed connection penalization (time based - failed connections won't be
20+
retried until a timeout is reached)
21+
* Support for TLS and HTTP authentication
22+
* Thread safety across requests
23+
* Pluggable architecture
24+
* Helper functions for idiomatically using APIs together
25+
26+
## Quick Start
27+
28+
29+
```python
30+
# Import the client from the 'elasticsearch' module
31+
# Import the client from the 'elasticsearch' module
32+
>>> from elasticsearch_serverless import Elasticsearch
33+
34+
# Instantiate a client instance
35+
>>> client = Elasticsearch("http://localhost:9200")
36+
37+
# Call an API, in this example `info()`
38+
>>> resp = client.info()
39+
40+
# View the result
41+
>>> resp
42+
{
43+
"name" : "instance-name",
44+
"cluster_name" : "cluster-name",
45+
"cluster_uuid" : "cluster-uuid",
46+
"version" : {
47+
"number" : "7.14.0",
48+
...
49+
},
50+
"tagline" : "You know, for Search"
51+
}
52+
```
53+
54+
## License
55+
56+
This software is licensed under the [Apache License 2.0](./LICENSE). See [NOTICE](./NOTICE).

README.rst

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

catalog-info.yaml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,4 @@ spec:
3939
provider_settings:
4040
build_pull_requests: true
4141
build_branches: true
42-
cancel_intermediate_builds: false
43-
schedules:
44-
main_daily:
45-
branch: 'main'
46-
cronline: '0 2 * * *'
42+
cancel_intermediate_builds: false

elasticsearch_serverless/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,14 @@
4242
logger = logging.getLogger("elasticsearch")
4343
logger.addHandler(logging.NullHandler())
4444

45+
warnings.warn(
46+
"elasticsearch-serverless is deprecated and will be discontinued with the 9.0.0 release of the Elastic Stack. "
47+
"Please migrate to the official elasticsearch-py package for continued support and improved features: "
48+
"https://github.com/elastic/elasticsearch-py",
49+
category=DeprecationWarning,
50+
stacklevel=2,
51+
)
52+
4553
from ._async.client import AsyncElasticsearch as AsyncElasticsearch
4654
from ._sync.client import Elasticsearch as Elasticsearch
4755
from .exceptions import ElasticsearchDeprecationWarning # noqa: F401

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ build-backend = "hatchling.build"
66
name = "elasticsearch-serverless"
77
version = "0.7.0.20231031"
88
description = "Python client for Elasticsearch Serverless"
9-
readme = "README.rst"
9+
readme = "README.md"
1010
license = "Apache-2.0"
1111
requires-python = ">=3.9"
1212
authors = [
@@ -90,7 +90,7 @@ include = [
9090
"/CONTRIBUTING.md",
9191
"/LICENSE",
9292
"/NOTICE",
93-
"/README.rst",
93+
"/README.md",
9494
"/setup.cfg",
9595
"/docs/sphinx",
9696
]

0 commit comments

Comments
 (0)