From 214c6d6fc4b90f8f62996dfdbdfa80216d9b0a2f Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Mon, 26 Jul 2021 18:06:41 -0400 Subject: limit greenlet dependency to pypi-listed platforms 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. Fixes: #6136 Change-Id: I8f3a1c00a4a8b6a273484af1da1f7aaadf588ae7 --- lib/sqlalchemy/testing/requirements.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'lib/sqlalchemy/testing/requirements.py') diff --git a/lib/sqlalchemy/testing/requirements.py b/lib/sqlalchemy/testing/requirements.py index 702a40fe2..4fa701b10 100644 --- a/lib/sqlalchemy/testing/requirements.py +++ b/lib/sqlalchemy/testing/requirements.py @@ -1319,6 +1319,18 @@ class SuiteRequirements(Requirements): 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" -- cgit v1.2.1