Skip to content

Commit f69476d

Browse files
[7.12] Update README and CONTRIBUTING.md
Co-authored-by: Seth Michael Larson <seth.larson@elastic.co>
1 parent 36cd483 commit f69476d

File tree

2 files changed

+48
-46
lines changed

2 files changed

+48
-46
lines changed

CONTRIBUTING.md

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Python Elasticsearch Client
1+
# Contributing to the Python Elasticsearch Client
22

33
If you have a bugfix or new feature that you would like to contribute to
44
elasticsearch-py, please find or open an issue about it first. Talk about what
@@ -10,11 +10,10 @@ We enjoy working with contributors to get their code accepted. There are many
1010
approaches to fixing a problem and it is important to find the best approach
1111
before writing too much code.
1212

13-
## Running Integration Tests
13+
## Running Elasticsearch locally
1414

15-
Integration tests are run against a live Elasticsearch instance in Docker.
16-
17-
Run the full integration test suite via `$ .ci/run-tests`.
15+
We've provided a script to start an Elasticsearch cluster of a certain version
16+
found at `.ci/run-elasticsearch.sh`.
1817

1918
There are several environment variables that control integration tests:
2019

@@ -28,6 +27,9 @@ There are several environment variables that control integration tests:
2827
without any non-free features or by beginning a Platinum license. Possible options
2928
are `free` and `platinum`. Defaults to `free` as there are fewer test cases.
3029

30+
**NOTE: You don't need to run the live integration tests for all changes. If
31+
you don't have Elasticsearch running locally the integration tests will be skipped.**
32+
3133
## API Code Generation
3234

3335
All the API methods (any method in `elasticsearch.client` classes decorated
@@ -40,18 +42,17 @@ Script](https://github.com/elastic/elasticsearch-py/blob/master/utils/generate_a
4042

4143
To run the code generation make sure you have pre-requisites installed:
4244

43-
* by running `pip install -e '.[develop]'`
45+
* by running `python -m pip install -e '.[develop]'`
4446
* having the [elasticsearch](https://github.com/elastic/elasticsearch) repo
4547
cloned on the same level as `elasticsearch-py` and switched to appropriate
4648
version
4749

4850
Then you should be able to run the code generation by invoking:
4951

5052
```
51-
$ python utils/generate_api.py
53+
$ python utils/generate-api.py
5254
```
5355

54-
5556
## Contributing Code Changes
5657

5758
The process for contributing to any of the Elasticsearch repositories is similar.
@@ -65,24 +66,22 @@ The process for contributing to any of the Elasticsearch repositories is similar
6566

6667
2. Run the linter and test suite to ensure your changes do not break existing code:
6768

68-
````
69-
# Install Nox for task management
70-
$ python -m pip install nox
71-
72-
# Auto-format and lint your changes
73-
$ nox -s format
69+
```
70+
# Install Nox for task management
71+
$ python -m pip install nox
7472
75-
# Run the test suite
76-
$ python setup.py test
77-
````
78-
79-
See the README file in `test_elasticsearch` directory for more information on
80-
running the test suite.
73+
# Auto-format and lint your changes
74+
$ nox -rs format
75+
76+
# Run the test suite
77+
$ nox -rs test
78+
```
8179

8280
3. Rebase your changes.
8381
Update your local repository with the most recent code from the main
8482
elasticsearch-py repository, and rebase your branch on top of the latest master
85-
branch. We prefer your changes to be squashed into a single commit.
83+
branch. We prefer your changes to be squashed into a single commit for easier
84+
backporting.
8685

8786
4. Submit a pull request. Push your local changes to your forked copy of the
8887
repository and submit a pull request. In the pull request, describe what your

README

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,22 @@
11
Python Elasticsearch Client
22
===========================
33

4+
.. image:: https://img.shields.io/pypi/v/elasticsearch
5+
:target: https://pypi.org/project/elasticsearch
6+
7+
.. image:: https://pepy.tech/badge/elasticsearch
8+
:target: https://pepy.tech/project/elasticsearch?versions=*
9+
10+
.. image:: https://clients-ci.elastic.co/job/elastic+elasticsearch-py+master/badge/icon
11+
:target: https://clients-ci.elastic.co/job/elastic+elasticsearch-py+master
12+
13+
.. image:: https://readthedocs.org/projects/elasticsearch-py/badge/?version=latest&style=flat
14+
:target: https://elasticsearch-py.readthedocs.io
15+
416
Official low-level client for Elasticsearch. Its goal is to provide common
517
ground for all Elasticsearch-related code in Python; because of this it tries
618
to be opinion-free and very extendable.
719

8-
920
Installation
1021
------------
1122

@@ -62,7 +73,7 @@ versions are also released as ``elasticsearch2`` and ``elasticsearch5``.
6273
Example use
6374
-----------
6475

65-
Simple use-case::
76+
.. code-block:: python
6677

6778
>>> from datetime import datetime
6879
>>> from elasticsearch import Elasticsearch
@@ -89,17 +100,17 @@ Simple use-case::
89100
>>> es.get(index="my-index", id=42)['_source']
90101
{'any': 'data', 'timestamp': '2019-05-17T17:28:10.329598'}
91102

92-
`Full documentation`_.
103+
Elastic Cloud (and SSL) use-case:
93104

94-
.. _Full documentation: https://elasticsearch-py.readthedocs.io/
95-
96-
Elastic Cloud (and SSL) use-case::
105+
.. code-block:: python
97106

98107
>>> from elasticsearch import Elasticsearch
99108
>>> es = Elasticsearch(cloud_id="<some_long_cloud_id>", http_auth=('elastic','yourpassword'))
100109
>>> es.info()
101110

102-
Using SSL Context with a self-signed cert use-case::
111+
Using SSL Context with a self-signed cert use-case:
112+
113+
.. code-block:: python
103114

104115
>>> from elasticsearch import Elasticsearch
105116
>>> from ssl import create_default_context
@@ -114,16 +125,16 @@ Features
114125

115126
The client's features include:
116127

117-
* translating basic Python data types to and from json (datetimes are not
118-
decoded for performance reasons)
119-
* configurable automatic discovery of cluster nodes
120-
* persistent connections
121-
* load balancing (with pluggable selection strategy) across all available nodes
122-
* failed connection penalization (time based - failed connections won't be
123-
retried until a timeout is reached)
124-
* support for ssl and http authentication
125-
* thread safety
126-
* pluggable architecture
128+
* translating basic Python data types to and from json (datetimes are not
129+
decoded for performance reasons)
130+
* configurable automatic discovery of cluster nodes
131+
* persistent connections
132+
* load balancing (with pluggable selection strategy) across all available nodes
133+
* failed connection penalization (time based - failed connections won't be
134+
retried until a timeout is reached)
135+
* support for ssl and http authentication
136+
* thread safety
137+
* pluggable architecture
127138

128139

129140
Elasticsearch-DSL
@@ -163,11 +174,3 @@ distributed under the License is distributed on an "AS IS" BASIS,
163174
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
164175
See the License for the specific language governing permissions and
165176
limitations under the License.
166-
167-
Build Status
168-
------------
169-
.. image:: https://readthedocs.org/projects/elasticsearch-py/badge/?version=latest&style=flat
170-
:target: https://elasticsearch-py.readthedocs.io/en/master/
171-
172-
.. image:: https://clients-ci.elastic.co/job/elastic+elasticsearch-py+master/badge/icon
173-
:target: https://clients-ci.elastic.co/job/elastic+elasticsearch-py+master/

0 commit comments

Comments
 (0)