From cd03b8f0cecbf72ecd6c99c4d3a6338c8278b40d Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Wed, 12 Aug 2020 18:46:25 -0400 Subject: Use importlib_metadata; add namespace for mariadb The ``importlib_metadata`` library is used to scan for setuptools entrypoints rather than pkg_resources. as importlib_metadata is a small library that is included as of Python 3.8, the compatibility library is installed as a dependency for Python versions older than 3.8. Unfortunately setuptools "attr:" is broken because it tries to import the module; seems like this is fixed as part of https://github.com/pypa/setuptools/pull/1753 however this is too recent to rely upon for now. Added a new dialect token "mariadb" that may be used in place of "mysql" in the :func:`_sa.create_engine` URL. This will deliver a MariaDB dialect subclass of the MySQLDialect in use that forces the "is_mariadb" flag to True. The dialect will raise an error if a server version string that does not indicate MariaDB in use is received. This is useful for MariaDB-specific testing scenarios as well as to support applications that are hardcoding to MariaDB-only concepts. As MariaDB and MySQL featuresets and usage patterns continue to diverge, this pattern may become more prominent. Fixes: #5400 Fixes: #5496 Change-Id: I330815ebe572b6a9818377da56621397335fa702 --- setup.cfg | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'setup.cfg') diff --git a/setup.cfg b/setup.cfg index d1b46bc53..9cbdbd838 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,9 @@ [metadata] name = SQLAlchemy -version = attr: sqlalchemy.__version__ +# version comes from setup.py; setuptools +# can't read the "attr:" here without importing +# until version 47.0.0 which is too recent + description = Database Abstraction Library long_description = file: README.rst long_description_content_type = text/x-rst @@ -34,6 +37,9 @@ packages = find: python_requires = >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.* package_dir = =lib +install_requires = + importlib-metadata;python_version<"3.8" + [options.extras_require] mssql = pyodbc -- cgit v1.2.1