Skip to content

Commit

Permalink
Fix a typing issue with typed scrapy, bump mypy.
Browse files Browse the repository at this point in the history
  • Loading branch information
wRAR committed Nov 19, 2024
1 parent a75802e commit 4cdd206
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 5 additions & 1 deletion itemadapter/_imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 2 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down

0 comments on commit 4cdd206

Please sign in to comment.