diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2021-07-26 18:06:41 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2021-08-11 12:53:20 -0400 |
| commit | 214c6d6fc4b90f8f62996dfdbdfa80216d9b0a2f (patch) | |
| tree | 9fecce4341e08de507268a7b976756875ee25f4b /lib/sqlalchemy/testing | |
| parent | c6b1d24fe71c22e4d2117d084f06df3597671985 (diff) | |
| download | sqlalchemy-214c6d6fc4b90f8f62996dfdbdfa80216d9b0a2f.tar.gz | |
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
Diffstat (limited to 'lib/sqlalchemy/testing')
| -rw-r--r-- | lib/sqlalchemy/testing/requirements.py | 12 |
1 files changed, 12 insertions, 0 deletions
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 @@ -1320,6 +1320,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" return exclusions.closed() |
