diff options
-rw-r--r-- | alembic/operations/batch.py | 12 | ||||
-rw-r--r-- | alembic/util/compat.py | 4 | ||||
-rw-r--r-- | alembic/util/pyfiles.py | 2 | ||||
-rw-r--r-- | setup.cfg | 6 |
4 files changed, 17 insertions, 7 deletions
diff --git a/alembic/operations/batch.py b/alembic/operations/batch.py index f5ff0bb..ef182fd 100644 --- a/alembic/operations/batch.py +++ b/alembic/operations/batch.py @@ -466,9 +466,11 @@ class ApplyBatchImpl: if ( "existing_type" in kw and isinstance(kw["existing_type"], SchemaEventTarget) - and kw["existing_type"].name + and kw["existing_type"].name # type:ignore[attr-defined] ): - self.named_constraints.pop(kw["existing_type"].name, None) + self.named_constraints.pop( + kw["existing_type"].name, None # type:ignore[attr-defined] + ) if type_ is not None: type_ = sqltypes.to_instance(type_) @@ -590,9 +592,11 @@ class ApplyBatchImpl: if ( "existing_type" in kw and isinstance(kw["existing_type"], SchemaEventTarget) - and kw["existing_type"].name + and kw["existing_type"].name # type:ignore[attr-defined] ): - self.named_constraints.pop(kw["existing_type"].name, None) + self.named_constraints.pop( + kw["existing_type"].name, None # type:ignore[attr-defined] + ) def create_column_comment(self, column): """the batch table creation function will issue create_column_comment diff --git a/alembic/util/compat.py b/alembic/util/compat.py index d0e6672..1e435a8 100644 --- a/alembic/util/compat.py +++ b/alembic/util/compat.py @@ -27,12 +27,12 @@ class EncodedIO(io.TextIOWrapper): if py39: from importlib import resources as importlib_resources else: - import importlib_resources # noqa + import importlib_resources # type:ignore[no-redef] # noqa if py38: from importlib import metadata as importlib_metadata else: - import importlib_metadata # noqa + import importlib_metadata # type:ignore[no-redef] # noqa def importlib_metadata_get(group): diff --git a/alembic/util/pyfiles.py b/alembic/util/pyfiles.py index 3da32c3..b6662b7 100644 --- a/alembic/util/pyfiles.py +++ b/alembic/util/pyfiles.py @@ -58,7 +58,7 @@ def coerce_resource_to_filename(fname: str) -> str: ref = compat.importlib_resources.files(tokens[0]) for tok in tokens[1:]: ref = ref / tok - fname = file_manager.enter_context( + fname = file_manager.enter_context( # type: ignore[assignment] compat.importlib_resources.as_file(ref) ) return fname @@ -127,3 +127,9 @@ ignore_missing_imports = True [mypy-sqlalchemy.testing.*] ignore_missing_imports = True + +[mypy-importlib_resources.*] +ignore_missing_imports = True + +[mypy-importlib_metadata.*] +ignore_missing_imports = True |