]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Add DeclarativeMeta to globals
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 28 Mar 2021 15:09:40 +0000 (11:09 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 31 Mar 2021 18:44:14 +0000 (14:44 -0400)
commit803a2373f58e794499e1e0b476db4c23e8dd7f87
tree6106a2f031cbc0fbb4429d295aef4c486afbae7a
parent2c2e01a0c6d0847f5648fd0120c8fa0bd5f6268f
Add DeclarativeMeta to globals

Fixed issue in mypy plugin where newly added support for
:func:`_orm.as_declarative` needed to more fully add the
``DeclarativeMeta`` class to the mypy interpreter's state so that it does
not result in a name not found error; additionally improves how global
names are setup for the plugin including the ``Mapped`` name.

Introduces directory oriented testing as well, where a full
set of files will be copied, mypy runs, then zero or more patches
are applied and mypy is run again, to fully test incremental
behaviors.

Fixes: sqlalchemy/sqlalchemy2-stubs/#14
Change-Id: Ide785c07e19ba0694e8cf6f91560094ecb182016
13 files changed:
MANIFEST.in
doc/build/changelog/unreleased_14/stubs_14.rst [new file with mode: 0644]
lib/sqlalchemy/ext/mypy/decl_class.py
lib/sqlalchemy/ext/mypy/plugin.py
lib/sqlalchemy/ext/mypy/util.py
lib/sqlalchemy/testing/requirements.py
test/ext/mypy/files/as_declarative.py
test/ext/mypy/incremental/stubs_14/__init__.py [new file with mode: 0644]
test/ext/mypy/incremental/stubs_14/address.py [new file with mode: 0644]
test/ext/mypy/incremental/stubs_14/patch1.testpatch [new file with mode: 0644]
test/ext/mypy/incremental/stubs_14/user.py [new file with mode: 0644]
test/ext/mypy/test_mypy_plugin_py3k.py
tox.ini