From 2ae0a3ca6403ca66c20ebdf6fc87a1fd2ea40d5a Mon Sep 17 00:00:00 2001 From: Siddhesh Kulkarni <143459031+Sidmsu@users.noreply.github.com> Date: Thu, 2 Jul 2026 11:57:07 -0700 Subject: [PATCH] Broader sweep of stale module-level docstrings (#7699) Extends the previous pass to 28 more modules that had the same redundant pattern: a one-line description restating the module/class name plus a "See documentation in docs/topics/*.rst" pointer, with no information not already present in the linked docs or in class docstrings pulled into the docs via autoclass/autodoc. Verified per file that nothing unique was lost, e.g. the Selector type-inference behavior described in html.py/xml.py is already documented on scrapy.Selector (autoclass'd in docs/topics/selectors.rst), and CrawlSpider/XMLFeedSpider/CSVFeedSpider details are documented in docs/topics/spiders.rst in more depth than the module docstrings had. --- scrapy/commands/shell.py | 6 ------ scrapy/core/downloader/middleware.py | 6 ------ scrapy/core/spidermw.py | 6 ------ scrapy/downloadermiddlewares/defaultheaders.py | 6 ------ scrapy/downloadermiddlewares/httpauth.py | 6 ------ scrapy/extensions/closespider.py | 6 ------ scrapy/extensions/debug.py | 6 ------ scrapy/extensions/feedexport.py | 6 ------ scrapy/extensions/memdebug.py | 6 ------ scrapy/extensions/memusage.py | 6 ------ scrapy/extensions/telnet.py | 6 ------ scrapy/http/request/__init__.py | 7 ------- scrapy/http/request/form.py | 7 ------- scrapy/http/request/json_request.py | 7 ------- scrapy/http/request/rpc.py | 7 ------- scrapy/http/response/__init__.py | 7 ------- scrapy/http/response/html.py | 8 -------- scrapy/http/response/json.py | 7 ------- scrapy/http/response/text.py | 7 ------- scrapy/http/response/xml.py | 8 -------- scrapy/item.py | 6 ------ scrapy/pipelines/__init__.py | 6 ------ scrapy/shell.py | 6 ------ scrapy/spidermiddlewares/depth.py | 6 ------ scrapy/spidermiddlewares/httperror.py | 6 ------ scrapy/spidermiddlewares/urllength.py | 6 ------ scrapy/spiders/__init__.py | 6 ------ scrapy/spiders/crawl.py | 7 ------- scrapy/spiders/feed.py | 7 ------- 29 files changed, 187 deletions(-) diff --git a/scrapy/commands/shell.py b/scrapy/commands/shell.py index 19138ffd0..1e57b4a8a 100644 --- a/scrapy/commands/shell.py +++ b/scrapy/commands/shell.py @@ -1,9 +1,3 @@ -""" -Scrapy Shell - -See documentation in docs/topics/shell.rst -""" - from __future__ import annotations import asyncio diff --git a/scrapy/core/downloader/middleware.py b/scrapy/core/downloader/middleware.py index ab74e22a4..2f811cac0 100644 --- a/scrapy/core/downloader/middleware.py +++ b/scrapy/core/downloader/middleware.py @@ -1,9 +1,3 @@ -""" -Downloader Middleware manager - -See documentation in docs/topics/downloader-middleware.rst -""" - from __future__ import annotations import warnings diff --git a/scrapy/core/spidermw.py b/scrapy/core/spidermw.py index fbc6f2530..bf31cb454 100644 --- a/scrapy/core/spidermw.py +++ b/scrapy/core/spidermw.py @@ -1,9 +1,3 @@ -""" -Spider Middleware manager - -See documentation in docs/topics/spider-middleware.rst -""" - from __future__ import annotations import logging diff --git a/scrapy/downloadermiddlewares/defaultheaders.py b/scrapy/downloadermiddlewares/defaultheaders.py index 7c940a078..5aa8f37d7 100644 --- a/scrapy/downloadermiddlewares/defaultheaders.py +++ b/scrapy/downloadermiddlewares/defaultheaders.py @@ -1,9 +1,3 @@ -""" -DefaultHeaders downloader middleware - -See documentation in docs/topics/downloader-middleware.rst -""" - from __future__ import annotations from typing import TYPE_CHECKING diff --git a/scrapy/downloadermiddlewares/httpauth.py b/scrapy/downloadermiddlewares/httpauth.py index b09abdadd..2eaa9e532 100644 --- a/scrapy/downloadermiddlewares/httpauth.py +++ b/scrapy/downloadermiddlewares/httpauth.py @@ -1,9 +1,3 @@ -""" -HTTP basic auth downloader middleware - -See documentation in docs/topics/downloader-middleware.rst -""" - from __future__ import annotations import warnings diff --git a/scrapy/extensions/closespider.py b/scrapy/extensions/closespider.py index a4362b182..1c007c7da 100644 --- a/scrapy/extensions/closespider.py +++ b/scrapy/extensions/closespider.py @@ -1,9 +1,3 @@ -"""CloseSpider is an extension that forces spiders to be closed after certain -conditions are met. - -See documentation in docs/topics/extensions.rst -""" - from __future__ import annotations import logging diff --git a/scrapy/extensions/debug.py b/scrapy/extensions/debug.py index 5def7509e..67bcfd1ea 100644 --- a/scrapy/extensions/debug.py +++ b/scrapy/extensions/debug.py @@ -1,9 +1,3 @@ -""" -Extensions for debugging Scrapy - -See documentation in docs/topics/extensions.rst -""" - from __future__ import annotations import contextlib diff --git a/scrapy/extensions/feedexport.py b/scrapy/extensions/feedexport.py index fa708a2e1..90199932e 100644 --- a/scrapy/extensions/feedexport.py +++ b/scrapy/extensions/feedexport.py @@ -1,9 +1,3 @@ -""" -Feed Exports extension - -See documentation in docs/topics/feed-exports.rst -""" - from __future__ import annotations import asyncio diff --git a/scrapy/extensions/memdebug.py b/scrapy/extensions/memdebug.py index 1fde6b296..ff4ef2703 100644 --- a/scrapy/extensions/memdebug.py +++ b/scrapy/extensions/memdebug.py @@ -1,9 +1,3 @@ -""" -MemoryDebugger extension - -See documentation in docs/topics/extensions.rst -""" - from __future__ import annotations import gc diff --git a/scrapy/extensions/memusage.py b/scrapy/extensions/memusage.py index 1444c8941..0f58611e3 100644 --- a/scrapy/extensions/memusage.py +++ b/scrapy/extensions/memusage.py @@ -1,9 +1,3 @@ -""" -MemoryUsage extension - -See documentation in docs/topics/extensions.rst -""" - from __future__ import annotations import logging diff --git a/scrapy/extensions/telnet.py b/scrapy/extensions/telnet.py index 3be24c53f..4b43c8338 100644 --- a/scrapy/extensions/telnet.py +++ b/scrapy/extensions/telnet.py @@ -1,9 +1,3 @@ -""" -Scrapy Telnet Console extension - -See documentation in docs/topics/telnetconsole.rst -""" - from __future__ import annotations import binascii diff --git a/scrapy/http/request/__init__.py b/scrapy/http/request/__init__.py index 73c2e7dd4..acf1c57c6 100644 --- a/scrapy/http/request/__init__.py +++ b/scrapy/http/request/__init__.py @@ -1,10 +1,3 @@ -""" -This module implements the Request class which is used to represent HTTP -requests in Scrapy. - -See documentation in docs/topics/request-response.rst -""" - from __future__ import annotations import inspect diff --git a/scrapy/http/request/form.py b/scrapy/http/request/form.py index f1a8dbf3b..a97cfd2de 100644 --- a/scrapy/http/request/form.py +++ b/scrapy/http/request/form.py @@ -1,10 +1,3 @@ -""" -This module implements the FormRequest class which is a more convenient class -(than Request) to generate Requests based on form data. - -See documentation in docs/topics/request-response.rst -""" - from __future__ import annotations from collections.abc import Iterable diff --git a/scrapy/http/request/json_request.py b/scrapy/http/request/json_request.py index 13fee06d8..97d877702 100644 --- a/scrapy/http/request/json_request.py +++ b/scrapy/http/request/json_request.py @@ -1,10 +1,3 @@ -""" -This module implements the JsonRequest class which is a more convenient class -(than Request) to generate JSON Requests. - -See documentation in docs/topics/request-response.rst -""" - from __future__ import annotations import copy diff --git a/scrapy/http/request/rpc.py b/scrapy/http/request/rpc.py index c68c8aabd..d0cededc5 100644 --- a/scrapy/http/request/rpc.py +++ b/scrapy/http/request/rpc.py @@ -1,10 +1,3 @@ -""" -This module implements the XmlRpcRequest class which is a more convenient class -(that Request) to generate xml-rpc requests. - -See documentation in docs/topics/request-response.rst -""" - from __future__ import annotations import xmlrpc.client as xmlrpclib diff --git a/scrapy/http/response/__init__.py b/scrapy/http/response/__init__.py index 09b1c8b32..5690b3010 100644 --- a/scrapy/http/response/__init__.py +++ b/scrapy/http/response/__init__.py @@ -1,10 +1,3 @@ -""" -This module implements the Response class which is used to represent HTTP -responses in Scrapy. - -See documentation in docs/topics/request-response.rst -""" - from __future__ import annotations from typing import TYPE_CHECKING, Any, AnyStr, TypeVar, overload diff --git a/scrapy/http/response/html.py b/scrapy/http/response/html.py index 6d3a9ee12..e62846764 100644 --- a/scrapy/http/response/html.py +++ b/scrapy/http/response/html.py @@ -1,11 +1,3 @@ -""" -This module implements the :class:`HtmlResponse` class which is used as a -content type marker by :class:`~scrapy.selector.Selector` and can be used in -``isinstance()`` checks. - -See documentation in docs/topics/request-response.rst -""" - from scrapy.http.response.text import TextResponse diff --git a/scrapy/http/response/json.py b/scrapy/http/response/json.py index 0428dde6e..74b0ed0c9 100644 --- a/scrapy/http/response/json.py +++ b/scrapy/http/response/json.py @@ -1,10 +1,3 @@ -""" -This module implements the JsonResponse class that is used when the response -has a JSON MIME type in its Content-Type header. - -See documentation in docs/topics/request-response.rst -""" - from scrapy.http.response.text import TextResponse diff --git a/scrapy/http/response/text.py b/scrapy/http/response/text.py index 6876e35e8..c277d2412 100644 --- a/scrapy/http/response/text.py +++ b/scrapy/http/response/text.py @@ -1,10 +1,3 @@ -""" -This module implements the TextResponse class which adds encoding handling and -discovering (through HTTP headers) to base Response class. - -See documentation in docs/topics/request-response.rst -""" - from __future__ import annotations import json diff --git a/scrapy/http/response/xml.py b/scrapy/http/response/xml.py index 847fb2b3c..64496b8ca 100644 --- a/scrapy/http/response/xml.py +++ b/scrapy/http/response/xml.py @@ -1,11 +1,3 @@ -""" -This module implements the :class:`XmlResponse` class which is used as a -content type marker by :class:`~scrapy.selector.Selector` and can be used in -``isinstance()`` checks. - -See documentation in docs/topics/request-response.rst -""" - from scrapy.http.response.text import TextResponse diff --git a/scrapy/item.py b/scrapy/item.py index 4d99ea79d..79333a7d1 100644 --- a/scrapy/item.py +++ b/scrapy/item.py @@ -1,9 +1,3 @@ -""" -Scrapy Item - -See documentation in docs/topics/items.rst -""" - from __future__ import annotations from abc import ABCMeta diff --git a/scrapy/pipelines/__init__.py b/scrapy/pipelines/__init__.py index 383c461e6..9e8bc4df3 100644 --- a/scrapy/pipelines/__init__.py +++ b/scrapy/pipelines/__init__.py @@ -1,9 +1,3 @@ -""" -Item pipeline - -See documentation in docs/topics/item-pipeline.rst -""" - from __future__ import annotations import asyncio diff --git a/scrapy/shell.py b/scrapy/shell.py index dfea00c46..1856787c4 100644 --- a/scrapy/shell.py +++ b/scrapy/shell.py @@ -1,9 +1,3 @@ -"""Scrapy Shell - -See documentation in docs/topics/shell.rst - -""" - from __future__ import annotations import asyncio diff --git a/scrapy/spidermiddlewares/depth.py b/scrapy/spidermiddlewares/depth.py index 9c387530c..9179c97de 100644 --- a/scrapy/spidermiddlewares/depth.py +++ b/scrapy/spidermiddlewares/depth.py @@ -1,9 +1,3 @@ -""" -Depth Spider Middleware - -See documentation in docs/topics/spider-middleware.rst -""" - from __future__ import annotations import logging diff --git a/scrapy/spidermiddlewares/httperror.py b/scrapy/spidermiddlewares/httperror.py index 156b73e7e..009704833 100644 --- a/scrapy/spidermiddlewares/httperror.py +++ b/scrapy/spidermiddlewares/httperror.py @@ -1,9 +1,3 @@ -""" -HttpError Spider Middleware - -See documentation in docs/topics/spider-middleware.rst -""" - from __future__ import annotations import logging diff --git a/scrapy/spidermiddlewares/urllength.py b/scrapy/spidermiddlewares/urllength.py index f325ce7a0..a938cd69e 100644 --- a/scrapy/spidermiddlewares/urllength.py +++ b/scrapy/spidermiddlewares/urllength.py @@ -1,9 +1,3 @@ -""" -Url Length Spider Middleware - -See documentation in docs/topics/spider-middleware.rst -""" - from __future__ import annotations import logging diff --git a/scrapy/spiders/__init__.py b/scrapy/spiders/__init__.py index de527d04f..52422ce62 100644 --- a/scrapy/spiders/__init__.py +++ b/scrapy/spiders/__init__.py @@ -1,9 +1,3 @@ -""" -Base class for Scrapy spiders - -See documentation in docs/topics/spiders.rst -""" - from __future__ import annotations import logging diff --git a/scrapy/spiders/crawl.py b/scrapy/spiders/crawl.py index 373c0b8b5..19c054035 100644 --- a/scrapy/spiders/crawl.py +++ b/scrapy/spiders/crawl.py @@ -1,10 +1,3 @@ -""" -This modules implements the CrawlSpider which is the recommended spider to use -for scraping typical websites that requires crawling pages. - -See documentation in docs/topics/spiders.rst -""" - from __future__ import annotations import copy diff --git a/scrapy/spiders/feed.py b/scrapy/spiders/feed.py index 925f31ede..b7d582092 100644 --- a/scrapy/spiders/feed.py +++ b/scrapy/spiders/feed.py @@ -1,10 +1,3 @@ -""" -This module implements the XMLFeedSpider which is the recommended spider to use -for scraping from an XML feed. - -See documentation in docs/topics/spiders.rst -""" - from __future__ import annotations from typing import TYPE_CHECKING, Any