--- /dev/null
+.. change::
+ :tags: bug, general
+ :tickets: 6136
+
+ The setup requirements have been modified such ``greenlet`` is a default
+ requirement only for those platforms that are well known for ``greenlet``
+ to be installable and for which there is already a pre-built binary on
+ pypi; the current list is ``x86_64 aarch64 ppc64le amd64 win32``. For other
+ platforms, greenlet will not install by default, which should enable
+ installation and test suite running of SQLAlchemy 1.4 on platforms that
+ don't support ``greenlet``, excluding any asyncio features. In order to
+ install with the ``greenlet`` dependency included on a machine architecture
+ outside of the above list, the ``[asyncio]`` extra may be included by
+ running ``pip install sqlalchemy[asyncio]`` which will then attempt to
+ install ``greenlet``.
+
+ Additionally, the test suite has been repaired so that tests can complete
+ fully when greenlet is not installed, with appropriate skips for
+ asyncio-related tests.
\ No newline at end of file
:ref:`change_5634`
+AsyncIO Support
+----------------
+
+SQLAlchemy's ``asyncio`` support depends upon the
+`greenlet <https://pypi.org/project/greenlet/>`_ project. This dependency
+will be installed by default on common machine platforms, however is not
+supported on every architecture and also may not install by default on
+less common architectures. See the section :ref:`asyncio_install` for
+additional details on ensuring asyncio support is present.
+
Supported Installation Methods
-------------------------------
.. versionadded:: 1.4
-The asyncio extension requires at least Python version 3.6.
-
.. note:: The asyncio extension as of SQLAlchemy 1.4.3 can now be considered to
be **beta level** software. API details are subject to change however at this
point it is unlikely for there to be significant backwards-incompatible
changes.
-
.. seealso::
:ref:`change_3414` - initial feature announcement
:ref:`examples_asyncio` - example scripts illustrating working examples
of Core and ORM use within the asyncio extension.
+.. _asyncio_install:
+
+Asyncio Platform Installation Notes
+------------------------------------
+
+The asyncio extension requires at least Python version 3.6. It also depends
+upon the `greenlet <https://pypi.org/project/greenlet/>`_ library. This
+dependency is installed by default on common machine platforms including::
+
+ x86_64 aarch64 ppc64le amd64 win32
+
+For the above platforms, ``greenlet`` is known to supply pre-built wheel files.
+To ensure the ``greenlet`` dependency is present on other platforms, the
+``[asyncio]`` extra may be installed as follows, which will include an attempt
+to build and install ``greenlet``::
+
+ pip install sqlalchemy[asyncio]
+
+
Synopsis - Core
---------------
return exclusions.closed()
+ @property
+ def greenlet(self):
+ def go(config):
+ try:
+ import greenlet # noqa F401
+ except ImportError:
+ return False
+ else:
+ return True
+
+ return exclusions.only_if(go)
+
@property
def computed_columns(self):
"Supports computed columns"
install_requires =
importlib-metadata;python_version<"3.8"
- greenlet != 0.4.17;python_version>="3"
+ greenlet != 0.4.17;python_version>="3" and platform_machine in 'x86_64 aarch64 ppc64le amd64 win32'
[options.extras_require]
asyncio =
class TestAsyncioCompat(fixtures.TestBase):
+ __requires__ = ("greenlet",)
+
@async_test
async def test_ok(self):
class TestAsyncAdaptedQueue(fixtures.TestBase):
# uses asyncio.run() in alternate threads which is not available
# in Python 3.6
- __requires__ = ("python37",)
+ __requires__ = ("python37", "greenlet")
def test_lazy_init(self):
run = [False]
pytest>=4.6.11,<5.0; python_version < '3'
pytest>=6.2; python_version >= '3'
pytest-xdist
- greenlet != 0.4.17
mock; python_version < '3.3'
- importlib_metadata; python_version < '3.8'
sqlite: .[aiosqlite]
sqlite_file: .[aiosqlite]