diff --git a/CHANGES.rst b/CHANGES.rst index 019e11c..471a1cb 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,6 +1,47 @@ Changes ======= +0.10.0 (2024-11-DD) +------------------- + +* Dropped Python 3.8 support, added Python 3.13 support. + +* Increased the minimum required versions of some dependencies: + + * ``pydantic``: ``2`` → ``2.1`` + + * ``scrapy-poet``: ``0.21.0`` → ``0.24.0`` + + * ``scrapy-spider-metadata``: ``0.1.2`` → ``0.2.0`` + + * ``scrapy-zyte-api[provider]``: ``0.16.0`` → ``0.23.0`` + + * ``zyte-common-items``: ``0.22.0`` → ``0.23.0`` + +* Added :ref:`custom attributes ` support to the + :ref:`e-commerce spider template ` through its new + :class:`~zyte_spider_templates.spiders.ecommerce.EcommerceSpiderParams.custom_attrs_input` + and + :class:`~zyte_spider_templates.spiders.ecommerce.EcommerceSpiderParams.custom_attrs_method` + parameters. + +* The + :class:`~zyte_spider_templates.spiders.serp.GoogleSearchSpiderParams.max_pages` + parameter of the :ref:`Google Search spider template ` can no + longer be 0 or lower. + +* The :ref:`Google Search spider template ` now follows + pagination for the results of each query page by page, instead of sending a + request for every page in parallel. It stops once it reaches a page without + organic results. + +* Improved the description of + :class:`~zyte_spider_templates.spiders.ecommerce.EcommerceCrawlStrategy` + values. + +* Fixed type hint issues related to Scrapy. + + 0.9.0 (2024-09-17) ------------------ diff --git a/docs/conf.py b/docs/conf.py index 406490e..a526125 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -46,6 +46,10 @@ "https://web-poet.readthedocs.io/en/stable", None, ), + "zyte": ( + "https://docs.zyte.com", + None, + ), "zyte-common-items": ( "https://zyte-common-items.readthedocs.io/en/latest", None, @@ -57,6 +61,7 @@ autodoc_pydantic_model_show_json = False autodoc_pydantic_model_show_validator_members = False autodoc_pydantic_model_show_validator_summary = False +autodoc_pydantic_field_list_validators = False # sphinx-reredirects redirects = { diff --git a/docs/reference/index.rst b/docs/reference/index.rst index dd368dd..d623779 100644 --- a/docs/reference/index.rst +++ b/docs/reference/index.rst @@ -23,6 +23,14 @@ Pages Parameter mixins ================ +.. autopydantic_model:: zyte_spider_templates.params.CustomAttrsInputParam + :exclude-members: model_computed_fields + +.. autopydantic_model:: zyte_spider_templates.params.CustomAttrsMethodParam + :exclude-members: model_computed_fields + +.. autoenum:: zyte_spider_templates.params.CustomAttrsMethod + .. autopydantic_model:: zyte_spider_templates.params.ExtractFromParam :exclude-members: model_computed_fields diff --git a/zyte_spider_templates/params.py b/zyte_spider_templates/params.py index e74f3f8..0ef628a 100644 --- a/zyte_spider_templates/params.py +++ b/zyte_spider_templates/params.py @@ -155,7 +155,7 @@ def validate_input_group(model): class UrlsFileParam(BaseModel): - urls_file: str = Field(**URLS_FILE_FIELD_KWARGS) # type: ignore[misc, arg-type] + urls_file: str = Field(**URLS_FILE_FIELD_KWARGS) # type: ignore[call-overload, misc, arg-type] @model_validator(mode="after") def input_group(self): @@ -193,7 +193,7 @@ def parse_input_params(spider): class UrlParam(BaseModel): - url: str = Field(**URL_FIELD_KWARGS) # type: ignore[misc, arg-type] + url: str = Field(**URL_FIELD_KWARGS) # type: ignore[call-overload, misc, arg-type] URLS_FIELD_KWARGS = { @@ -247,7 +247,7 @@ def input_group(self): class UrlsParam(BaseModel): - urls: Optional[List[str]] = Field(**URLS_FIELD_KWARGS) # type: ignore[misc, arg-type] + urls: Optional[List[str]] = Field(**URLS_FIELD_KWARGS) # type: ignore[call-overload, misc, arg-type] @model_validator(mode="after") def input_group(self):