From 4cdd2068115ac22790946964acb0545756336e9e Mon Sep 17 00:00:00 2001 From: Andrey Rakhmatullin Date: Tue, 19 Nov 2024 13:35:49 +0500 Subject: [PATCH] Fix a typing issue with typed scrapy, bump mypy. --- itemadapter/_imports.py | 6 +++++- tox.ini | 5 ++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/itemadapter/_imports.py b/itemadapter/_imports.py index bbfbf6f..f14f91d 100644 --- a/itemadapter/_imports.py +++ b/itemadapter/_imports.py @@ -11,7 +11,11 @@ else: try: # handle deprecated base classes - _base_item_cls = getattr(scrapy.item, "_BaseItem", scrapy.item.BaseItem) + _base_item_cls = getattr( + scrapy.item, + "_BaseItem", + scrapy.item.BaseItem, # type: ignore[attr-defined] + ) except AttributeError: _scrapy_item_classes = (scrapy.item.Item,) else: diff --git a/tox.ini b/tox.ini index dd2d5a1..d196ac6 100644 --- a/tox.ini +++ b/tox.ini @@ -11,13 +11,12 @@ commands = [testenv:typing] basepython = python3 deps = - mypy==1.11.2 + mypy==1.13.0 attrs pydantic scrapy commands = - mypy --install-types --non-interactive \ - --ignore-missing-imports {posargs:itemadapter} + mypy {posargs:itemadapter} [testenv:pylint] deps =