]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Don't import provision.py unconditionally
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 3 Mar 2020 21:03:39 +0000 (16:03 -0500)
committermike bayer <mike_mp@zzzcomputing.com>
Wed, 4 Mar 2020 02:23:32 +0000 (02:23 +0000)
commiteac19424ff6ddf37b3fcf2b030676de1f6a02929
tree2e120b6a74663c43f74f9c54a75620d671d37657
parent47abc46efe92d06b7ee8ded59d528f1b731ba492
Don't import provision.py unconditionally

Removed the imports for provision.py from each dialect
and instead added a call in the central provision.py to
a new dialect level method load_provisioning().  The
provisioning registry works in the same way, so an existing
dialect that is using the provision.py system right now
by importing it as part of the package will still continue to
function.  However, to avoid pulling in the testing package when
the dialect is used in a non-testing context, the new hook may be
used.   Also removed a module-level dependency
of the testing framework on the orm package.

Revised an internal change to the test system added as a result of
:ticket:`5085` where a testing-related module per dialect would be loaded
unconditionally upon making use of that dialect, pulling in SQLAlchemy's
testing framework as well as the ORM into the module import space.   This
would only impact initial startup time and memory to a modest extent,
however it's best that these additional modules aren't reverse-dependent on
straight Core usage.

Fixes: #5180
Change-Id: I6355601da5f6f44d85a2bbc3acb5928559942b9c
(cherry picked from commit 598f2f7e557073f29563d4d567f43931fc03013f)
doc/build/changelog/unreleased_13/5180.rst [new file with mode: 0644]
lib/sqlalchemy/dialects/mssql/__init__.py
lib/sqlalchemy/dialects/mysql/__init__.py
lib/sqlalchemy/dialects/oracle/__init__.py
lib/sqlalchemy/dialects/postgresql/__init__.py
lib/sqlalchemy/dialects/sqlite/__init__.py
lib/sqlalchemy/engine/default.py
lib/sqlalchemy/engine/interfaces.py
lib/sqlalchemy/testing/assertions.py
lib/sqlalchemy/testing/provision.py