Skip to content

Scrapy, a fast high-level web crawling & scraping framework for Python.

Fix Sphinx warnings that will become errors (#8161)

Adrian7574d0042729
diff --git a/docs/news/1.x.rst b/docs/news/1.x.rst
index 598c2e40e..2de7a03d4 100644
--- a/docs/news/1.x.rst
+++ b/docs/news/1.x.rst
@@ -21,10 +21,15 @@ Scrapy 1.8.4 (2024-02-14)
Please, see the `cc65-xxvf-f7r9 security advisory`_ for more information.
+ .. _ReDoS vulnerabilities: https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS
+ .. _cc65-xxvf-f7r9 security advisory: https://github.com/scrapy/scrapy/security/advisories/GHSA-cc65-xxvf-f7r9
+
- :setting:`DOWNLOAD_MAXSIZE` and :setting:`DOWNLOAD_WARNSIZE` now also apply
to the decompressed response body. Please, see the `7j7m-v7m3-jqm7 security
advisory`_ for more information.
+ .. _7j7m-v7m3-jqm7 security advisory: https://github.com/scrapy/scrapy/security/advisories/GHSA-7j7m-v7m3-jqm7
+
- Also in relation with the `7j7m-v7m3-jqm7 security advisory`_, use of the
``scrapy.downloadermiddlewares.decompression`` module is discouraged and
will trigger a warning.
diff --git a/docs/topics/api.rst b/docs/topics/api.rst
index 5d78e7bd4..4c5e3b49a 100644
--- a/docs/topics/api.rst
+++ b/docs/topics/api.rst
@@ -211,59 +211,6 @@ There are several Stats Collectors available under the
Collector API defined by the :class:`~scrapy.statscollectors.StatsCollector`
class (which they all inherit from).
-.. module:: scrapy.statscollectors
-
-.. class:: StatsCollector
-
- .. method:: get_value(key, default=None)
-
- Return the value for the given stats key or default if it doesn't exist.
-
- .. method:: get_stats()
-
- Get all stats from the currently running spider as a dict.
-
- .. method:: set_value(key, value)
-
- Set the given value for the given stats key.
-
- .. method:: set_stats(stats)
-
- Override the current stats with the dict passed in ``stats`` argument.
-
- .. method:: inc_value(key, count=1, start=0)
-
- Increment the value of the given stats key, by the given count,
- assuming the start value given (when it's not set).
-
- .. method:: max_value(key, value)
-
- Set the given value for the given key only if current value for the
- same key is lower than value. If there is no current value for the
- given key, the value is always set.
-
- .. method:: min_value(key, value)
-
- Set the given value for the given key only if current value for the
- same key is greater than value. If there is no current value for the
- given key, the value is always set.
-
- .. method:: clear_stats()
-
- Clear all stats.
-
- The following methods are not part of the stats collection api but instead
- used when implementing custom stats collectors:
-
- .. method:: open_spider()
-
- Open the spider for stats collection.
-
- .. method:: close_spider()
-
- Close the spider. After this is called, no more specific stats
- can be accessed or collected.
-
Engine API
==========
diff --git a/docs/topics/spiders.rst b/docs/topics/spiders.rst
index ae79ec3ee..78645b0ba 100644
--- a/docs/topics/spiders.rst
+++ b/docs/topics/spiders.rst
@@ -35,7 +35,6 @@ below.
scrapy.Spider
=============
-.. class:: scrapy.spiders.Spider
.. autoclass:: scrapy.Spider
.. attribute:: name
diff --git a/docs/topics/stats.rst b/docs/topics/stats.rst
index 5e049ed65..5158fbc8c 100644
--- a/docs/topics/stats.rst
+++ b/docs/topics/stats.rst
@@ -86,7 +86,7 @@ Get all stats:
Available Stats Collectors
==========================
-.. currentmodule:: scrapy.statscollectors
+.. module:: scrapy.statscollectors
Besides the basic :class:`StatsCollector` there are other Stats Collectors
available in Scrapy which extend the basic Stats Collector. You can select