Skip to content

Commit

Permalink
Bump tool versions.
Browse files Browse the repository at this point in the history
  • Loading branch information
wRAR committed Oct 14, 2024
1 parent 39ef223 commit a838c97
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ repos:
language_version: python3
exclude: ^docs/tutorial-project/
repo: https://github.com/ambv/black
rev: 24.2.0
rev: 24.10.0
- hooks:
- id: isort
language_version: python3
Expand All @@ -22,4 +22,4 @@ repos:
- flake8-docstrings
- flake8-string-format
repo: https://github.com/pycqa/flake8
rev: 7.0.0
rev: 7.1.1
3 changes: 2 additions & 1 deletion tests/test_testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,8 @@ class MetadataLocalTime(Metadata):

@attrs.define(kw_only=True)
class ProductLocalTime(Product):
metadata: Optional[MetadataLocalTime]
# in newer zyte-common-items this should inherit from ProductMetadata
metadata: Optional[MetadataLocalTime] # type: ignore[assignment]


def _get_product_item(date: datetime.datetime) -> ProductLocalTime:
Expand Down
8 changes: 6 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,13 @@ commands =

[testenv:mypy]
deps =
mypy==1.8.0
mypy==1.11.2
aiohttp
py
pytest
types-requests
types-python-dateutil
zyte-common-items

commands = mypy web_poet tests

Expand Down Expand Up @@ -84,7 +88,7 @@ deps =
basepython = python3
deps =
twine==5.1.1
build==0.10.0
build==1.2.2
commands =
python -m build --sdist
twine check dist/*
4 changes: 2 additions & 2 deletions web_poet/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import inspect
from contextlib import suppress
from functools import update_wrapper, wraps
from typing import Callable, Dict, List, Optional, Tuple, Type, TypeVar
from typing import Callable, Dict, List, Optional, Tuple, Type, TypeVar, cast

import attrs
from itemadapter import ItemAdapter
Expand Down Expand Up @@ -163,7 +163,7 @@ def processed(page):
if method is not None:
# @field syntax
res = _field(method)
update_wrapper(res, method)
update_wrapper(cast(Callable, res), method)
return res
else:
# @field(...) syntax
Expand Down
4 changes: 2 additions & 2 deletions web_poet/testing/pytest.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,15 @@ def collect(self) -> Iterable[Union[pytest.Item, pytest.Collector]]:
WebPoetItem.from_parent(parent=self, name="item", fixture=self.fixture)
]
else:
overall_tests = [
overall_tests: List[pytest.Item] = [
WebPoetNoToItemException.from_parent(
parent=self, name="TO_ITEM_DOESNT_RAISE", fixture=self.fixture
),
WebPoetNoExtraFieldsItem.from_parent(
parent=self, name="NO_EXTRA_FIELDS", fixture=self.fixture
),
]
field_tests = [
field_tests: List[pytest.Item] = [
WebPoetFieldItem.from_parent(
parent=self, name=field, fixture=self.fixture, field_name=field
)
Expand Down

0 comments on commit a838c97

Please sign in to comment.