diff --git a/docs/guide/configuration.asciidoc b/docs/guide/configuration.asciidoc index f084754e8..cb467dc0d 100644 --- a/docs/guide/configuration.asciidoc +++ b/docs/guide/configuration.asciidoc @@ -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 diff --git a/docs/guide/getting-started.asciidoc b/docs/guide/getting-started.asciidoc index 4fd275aa0..aef383f5d 100644 --- a/docs/guide/getting-started.asciidoc +++ b/docs/guide/getting-started.asciidoc @@ -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] diff --git a/docs/sphinx/async.rst b/docs/sphinx/async.rst index 5a32905eb..262d25bae 100644 --- a/docs/sphinx/async.rst +++ b/docs/sphinx/async.rst @@ -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 `_ and `Aiohttp `_. 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 `_ - if you find an issue or have a question about async support. + $ python -m pip install elasticsearch[async] Getting Started with Async -------------------------- @@ -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? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/sphinx/quickstart.rst b/docs/sphinx/quickstart.rst index db01edffd..68a1c52ba 100644 --- a/docs/sphinx/quickstart.rst +++ b/docs/sphinx/quickstart.rst @@ -9,7 +9,7 @@ operations like indexing or searching documents. Requirements ------------ -- `Python `_ 3.6 or newer +- `Python `_ 3.7 or newer - `pip `_ diff --git a/noxfile.py b/noxfile.py index b9598a2d1..f2f4ebe28 100644 --- a/noxfile.py +++ b/noxfile.py @@ -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", @@ -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) diff --git a/setup.py b/setup.py index a27c663aa..f34d78730 100644 --- a/setup.py +++ b/setup.py @@ -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", @@ -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"],