From 2c9656979ab8c4a670f0fdd019869a5ea20aa22e Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Fri, 27 Aug 2021 12:38:16 -0400 Subject: [PATCH] bump importlib.resources req to 3.9 The importlib.resources.files() API was not added until 3.9. Change-Id: I62ef8974d6637394448346d7e0f86c6dd93f81a7 --- alembic/util/compat.py | 2 +- docs/build/unreleased/885.rst | 4 +++- setup.cfg | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/alembic/util/compat.py b/alembic/util/compat.py index f83901f7..d0e6672c 100644 --- a/alembic/util/compat.py +++ b/alembic/util/compat.py @@ -24,7 +24,7 @@ class EncodedIO(io.TextIOWrapper): pass -if py37: +if py39: from importlib import resources as importlib_resources else: import importlib_resources # noqa diff --git a/docs/build/unreleased/885.rst b/docs/build/unreleased/885.rst index 2faa2b03..5e7068f3 100644 --- a/docs/build/unreleased/885.rst +++ b/docs/build/unreleased/885.rst @@ -7,4 +7,6 @@ ``setuptools``. The functionality has been replaced with ``importlib.metadata`` and ``importlib.resources`` which are both part of Python std.lib, or via pypy dependency ``importlib-metadata`` for Python - version < 3.8 and ``importlib-resources`` for Python version < 3.7. + version < 3.8 and ``importlib-resources`` for Python version < 3.9 + (while importlib.resources was added to Python in 3.7, it did not include + the "files" API until 3.9). diff --git a/setup.cfg b/setup.cfg index fab504dd..32fed410 100644 --- a/setup.cfg +++ b/setup.cfg @@ -43,7 +43,7 @@ install_requires = SQLAlchemy>=1.3.0 Mako importlib-metadata;python_version<"3.8" - importlib-resources;python_version<"3.7" + importlib-resources;python_version<"3.9" [options.extras_require] tz = -- 2.47.2