Skip to content

Drop support for Python 3.6 #2268

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 7 commits into from
Jan 15, 2024
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
9 changes: 1 addition & 8 deletions docs/guide/configuration.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,12 @@ es = Elasticsearch(
[discrete]
==== TLS versions

Configuring the minimum TLS version to connect to is done via the `ssl_version` parameter. By default this is set to a minimum value of TLSv1.2. In Python 3.7+ you can use the new `ssl.TLSVersion` enumeration to specify versions.
Configuring the minimum TLS version to connect to is done via the `ssl_version` parameter. By default this is set to a minimum value of TLSv1.2. Use the `ssl.TLSVersion` enumeration to specify versions.

[source,python]
------------------------------------
import ssl

# Python 3.6
es = Elasticsearch(
...,
ssl_version=ssl.PROTOCOL_TSLv1_2
)

# Python 3.7+
es = Elasticsearch(
...,
ssl_version=ssl.TLSVersion.TLSv1_2
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/getting-started.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ operations with it.
[discrete]
=== Requirements

* https://www.python.org/[Python] 3.6 or newer
* https://www.python.org/[Python] 3.7 or newer
* https://pip.pypa.io/en/stable/[`pip`], installed by default alongside Python

[discrete]
Expand Down
23 changes: 9 additions & 14 deletions docs/sphinx/async.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,17 @@ Using Asyncio with Elasticsearch
.. py:module:: elasticsearch
:no-index:

Starting in ``elasticsearch-py`` v7.8.0 for Python 3.6+ the ``elasticsearch`` package supports async/await with
The ``elasticsearch`` package supports async/await with
`Asyncio <https://docs.python.org/3/library/asyncio.html>`_ and `Aiohttp <https://docs.aiohttp.org>`_.
You can either install ``aiohttp`` directly or use the ``[async]`` extra:

.. code-block:: bash

$ python -m pip install elasticsearch>=7.8.0 aiohttp
$ python -m pip install elasticsearch aiohttp

# - OR -

$ python -m pip install elasticsearch[async]>=7.8.0

.. note::
Async functionality is a new feature of this library in v7.8.0+ so
`please open an issue <https://github.com/elastic/elasticsearch-py/issues>`_
if you find an issue or have a question about async support.
$ python -m pip install elasticsearch[async]

Getting Started with Async
--------------------------
Expand Down Expand Up @@ -67,13 +62,13 @@ in the ``examples/fastapi-apm`` directory.
Frequently Asked Questions
--------------------------

NameError / ImportError when importing ``AsyncElasticsearch``?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ValueError when initializing ``AsyncElasticsearch``?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

If when trying to use ``AsyncElasticsearch`` and you're receiving a ``NameError`` or ``ImportError``
you should ensure that you're running Python 3.6+ (check with ``$ python --version``) and
that you have ``aiohttp`` installed in your environment (check with ``$ python -m pip freeze | grep aiohttp``).
If either of the above conditions is not met then async support won't be available.
If when trying to use ``AsyncElasticsearch`` you receive ``ValueError: You must
have 'aiohttp' installed to use AiohttpHttpNode`` you should ensure that you
have ``aiohttp`` installed in your environment (check with ``$ python -m pip
freeze | grep aiohttp``). Otherwise, async support won't be available.

What about the ``elasticsearch-async`` package?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion docs/sphinx/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ operations like indexing or searching documents.
Requirements
------------

- `Python <https://www.python.org/>`_ 3.6 or newer
- `Python <https://www.python.org/>`_ 3.7 or newer
- `pip <https://pip.pypa.io/en/stable/>`_


Expand Down
7 changes: 1 addition & 6 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,11 @@
INSTALL_ENV = {"AIOHTTP_NO_EXTENSIONS": "1"}


@nox.session(python=["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"])
@nox.session(python=["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"])
def test(session):
session.install(".[async,requests]", env=INSTALL_ENV, silent=False)
session.install("-r", "dev-requirements.txt", silent=False)

python_version = tuple(int(x) for x in session.python.split("."))
junit_xml = os.path.join(SOURCE_DIR, "junit", "elasticsearch-py-junit.xml")
pytest_argv = [
"pytest",
Expand All @@ -49,10 +48,6 @@ def test(session):
"--cache-clear",
"-vv",
]
# Python 3.6+ is required for async
if python_version < (3, 6):
pytest_argv.append("--ignore=test_elasticsearch/test_async/")

session.run(*pytest_argv)


Expand Down
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
Expand All @@ -90,7 +89,7 @@
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
],
python_requires=">=3.6",
python_requires=">=3.7",
install_requires=install_requires,
extras_require={
"requests": ["requests>=2.4.0, <3.0.0"],
Expand Down