Scrapy, a fast high-level web crawling & scraping framework for Python.
Upgrade CI pins (#8469)
scrapy-ci-pins[bot]1bc0473909e4
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlindex a7eed38dc..8f3de7630 100644--- a/.github/workflows/ci.yml+++ b/.github/workflows/ci.yml@@ -79,10 +79,9 @@ jobs:python-version: ${{ matrix.python-version }}- name: Set up uv- uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e # v10.3.2+ uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3with:cache-dependency-glob: |- docs/requirements.txtpyproject.tomltox.ini@@ -175,7 +174,7 @@ jobs:sudo apt-get install libxml2-dev libxslt-dev- name: Set up uv- uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e # v10.3.2+ uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3with:cache-dependency-glob: |pyproject.tomldiff --git a/.github/workflows/codspeed-walltime.yml b/.github/workflows/codspeed-walltime.ymlindex 232fdf197..ae618379d 100644--- a/.github/workflows/codspeed-walltime.yml+++ b/.github/workflows/codspeed-walltime.yml@@ -50,7 +50,7 @@ jobs:python-version: '3.15'- name: Set up uv- uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e # v10.3.2+ uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3with:cache-dependency-glob: |pyproject.tomldiff --git a/.github/workflows/codspeed.yml b/.github/workflows/codspeed.ymlindex 616636574..0461ff8af 100644--- a/.github/workflows/codspeed.yml+++ b/.github/workflows/codspeed.yml@@ -44,7 +44,7 @@ jobs:python-version: '3.15'- name: Set up uv- uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e # v10.3.2+ uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3with:cache-dependency-glob: |pyproject.tomldiff --git a/.github/workflows/publish.yml b/.github/workflows/publish.ymlindex 27a0e967b..64f28503d 100644--- a/.github/workflows/publish.yml+++ b/.github/workflows/publish.yml@@ -61,9 +61,8 @@ jobs:with:python-version: "3.14"- run: |- python -m pip install -r docs/requirements.txt- python -m pip install .- sphinx-build -b html -q docs docs/_build/html+ python -m pip install tox+ tox -e docspython extras/github-release-notes.py "$GITHUB_REF_NAME" docs/_build/html/news.md > release-notes.md- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2with:diff --git a/.github/workflows/tests-vcs-deps.yml b/.github/workflows/tests-vcs-deps.ymlindex a42fed9e5..d81ac3436 100644--- a/.github/workflows/tests-vcs-deps.yml+++ b/.github/workflows/tests-vcs-deps.yml@@ -44,7 +44,7 @@ jobs:sudo apt-get install automake libjpeg-dev libtool libxml2-dev libxslt-dev zlib1g-dev- name: Set up uv- uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e # v10.3.2+ uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3with:cache-dependency-glob: |pyproject.tomldiff --git a/.github/workflows/upgrade-ci-pins.yml b/.github/workflows/upgrade-ci-pins.ymlindex a23d5f34d..ab1ad21b2 100644--- a/.github/workflows/upgrade-ci-pins.yml+++ b/.github/workflows/upgrade-ci-pins.yml@@ -32,7 +32,7 @@ jobs:- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0with:python-version: "3.15"- - uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e # v10.3.2+ - uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3with:enable-cache: false- run: uv tool install pre-commitdiff --git a/.pre-commit-config.yaml b/.pre-commit-config.yamlindex 39dff6f6f..a01588b0c 100644--- a/.pre-commit-config.yaml+++ b/.pre-commit-config.yaml@@ -6,7 +6,7 @@ exclude: |)repos:- repo: https://github.com/astral-sh/ruff-pre-commit- rev: v0.16.10+ rev: v0.17.4hooks:- id: ruff-checkargs: [ --fix ]@@ -16,7 +16,7 @@ repos:hooks:- id: blacken-docsadditional_dependencies:- - black==26.5.1+ - black==26.10.1- repo: https://github.com/pre-commit/pre-commit-hooksrev: v6.0.0hooks:@@ -27,11 +27,11 @@ repos:hooks:- id: sphinx-lint- repo: https://github.com/scrapy/sphinx-scrapy- rev: 0.13.0+ rev: 0.15.0hooks:- id: sphinx-scrapy- repo: https://github.com/zizmorcore/zizmor-pre-commit- rev: v1.30.1+ rev: v1.32.0hooks:- id: zizmorargs: [--no-progress, --fix]diff --git a/AGENTS.md b/AGENTS.mdindex 319142314..bbe4803f8 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -74,10 +74,10 @@ This file adds what agents tend to get wrong.- Give new anchors short names without the `topics-` prefix. Keep existinganchors.- Wrap paragraphs at 79 characters.-- To upgrade `sphinx-scrapy`, change its `rev` in `.pre-commit-config.yaml`,- run `pre-commit run sphinx-scrapy --all-files` to sync `tox.ini` and- `docs/requirements.in`, then run `uv pip compile requirements.in -o- requirements.txt` in `docs/`.+- To upgrade `sphinx-scrapy`, change its `rev` in `.pre-commit-config.yaml`+ and run `pre-commit run sphinx-scrapy --all-files` to sync `tox.ini`.+- Documentation dependencies other than `sphinx-scrapy` go in the `docs`+ dependency group of `pyproject.toml`.## Git and GitHubdiff --git a/docs/requirements.in b/docs/requirements.indeleted file mode 100644index 5fb78580c..000000000--- a/docs/requirements.in+++ /dev/null@@ -1,10 +0,0 @@-h2-pydantic-scrapy-spider-metadata-sphinx-sphinx-notfound-page-sphinx-reredirects-sphinx-rtd-theme-sphinx-rtd-dark-mode-sphinx-scrapy==0.13.0-twisted>=26.10.0rc1diff --git a/docs/requirements.txt b/docs/requirements.txtdeleted file mode 100644index dfea89675..000000000--- a/docs/requirements.txt+++ /dev/null@@ -1,228 +0,0 @@-# This file was autogenerated by uv via the following command:-# uv pip compile requirements.in -o requirements.txt --python-version 3.14-aiohappyeyeballs==2.7.1- # via aiohttp-aiohttp==3.14.5- # via scrapy-aiosignal==1.4.0- # via aiohttp-alabaster==1.0.0- # via sphinx-annotated-types==0.8.0- # via pydantic-attrs==26.1.0- # via- # aiohttp- # service-identity- # twisted-automat==25.4.16- # via twisted-babel==2.18.0- # via sphinx-brotli==1.2.1- # via scrapy-certifi==2026.10.23- # via requests-cffi==2.1.1- # via cryptography-charset-normalizer==3.5.2- # via- # requests- # scrapy-constantly==23.10.4- # via twisted-cryptography==50.0.2- # via- # pyopenssl- # scrapy- # service-identity-cssselect==1.6.0- # via- # parsel- # scrapy-defusedxml==0.7.1- # via scrapy-docutils==0.22.4- # via- # sphinx- # sphinx-llm-friendly- # sphinx-rtd-theme- # sphinx-scrapy-filelock==4.2.4- # via tldextract-frozenlist==1.8.0- # via- # aiohttp- # aiosignal-h2==4.4.1- # via -r requirements.in-hpack==4.2.0- # via h2-hyperframe==6.1.0- # via h2-hyperlink==21.0.0- # via twisted-idna==3.20- # via- # hyperlink- # requests- # tldextract- # yarl-imagesize==2.0.1- # via sphinx-incremental==24.11.0- # via twisted-itemadapter==0.13.1- # via- # itemloaders- # scrapy-itemloaders==1.5.0- # via scrapy-jinja2==3.1.6- # via sphinx-jmespath==1.1.0- # via- # itemloaders- # parsel-lxml==6.1.3- # via- # parsel- # scrapy-markupsafe==3.0.4- # via jinja2-multidict==7.2.1- # via- # aiohttp- # yarl-packaging==26.3- # via- # incremental- # scrapy- # scrapy-spider-metadata- # sphinx- # sphinx-scrapy-parsel==1.12.1- # via- # itemloaders- # scrapy-platformdirs==4.13.5- # via scrapy-propcache==0.5.4- # via- # aiohttp- # yarl-protego==0.7.0- # via scrapy-pycparser==3.12- # via cffi-pydantic==2.14.1- # via- # -r requirements.in- # scrapy-spider-metadata-pydantic-core==2.50.1- # via pydantic-pydispatcher==2.0.7- # via scrapy-pygments==2.21.0- # via sphinx-pyopenssl==26.4.0- # via scrapy-queuelib==1.10.0- # via scrapy-requests==2.34.2- # via- # requests-file- # sphinx- # sphinxcontrib-youtube- # tldextract-requests-file==3.0.1- # via tldextract-roman-numerals==4.1.0- # via sphinx-scrapy==2.19.0- # via scrapy-spider-metadata-scrapy-spider-metadata==0.2.0- # via -r requirements.in-service-identity==26.1.0- # via scrapy-snowballstemmer==3.1.1- # via sphinx-sphinx==9.2.0- # via- # -r requirements.in- # sphinx-copybutton- # sphinx-design- # sphinx-last-updated-by-git- # sphinx-llm-friendly- # sphinx-notfound-page- # sphinx-reredirects- # sphinx-rtd-theme- # sphinx-scrapy- # sphinxcontrib-jquery- # sphinxcontrib-youtube-sphinx-copybutton==0.5.2- # via sphinx-scrapy-sphinx-design==0.7.0- # via sphinx-scrapy-sphinx-last-updated-by-git==0.3.8- # via sphinx-sitemap-sphinx-llm-friendly==0.7.0- # via sphinx-scrapy-sphinx-notfound-page==1.1.0- # via -r requirements.in-sphinx-reredirects==1.1.0- # via -r requirements.in-sphinx-rtd-dark-mode==1.3.0- # via -r requirements.in-sphinx-rtd-theme==3.1.0- # via- # -r requirements.in- # sphinx-rtd-dark-mode-sphinx-scrapy==0.13.0- # via -r requirements.in-sphinx-sitemap==2.9.0- # via sphinx-scrapy-sphinxcontrib-applehelp==2.0.0- # via sphinx-sphinxcontrib-devhelp==2.0.0- # via sphinx-sphinxcontrib-htmlhelp==2.1.0- # via sphinx-sphinxcontrib-jquery==4.1- # via sphinx-rtd-theme-sphinxcontrib-jsmath==2.0.0- # via sphinx-sphinxcontrib-qthelp==2.0.0- # via sphinx-sphinxcontrib-serializinghtml==2.0.0- # via sphinx-sphinxcontrib-youtube==1.5.0- # via sphinx-scrapy-tabulate==0.10.0- # via sphinx-llm-friendly-tldextract==5.4.0- # via scrapy-twisted==26.10.0rc1- # via- # -r requirements.in- # scrapy-typing-extensions==4.16.0- # via- # pydantic- # pydantic-core- # twisted- # typing-inspection-typing-inspection==0.4.4- # via pydantic-urllib3==2.8.0- # via requests-w3lib==2.5.0- # via- # parsel- # scrapy-yarl==1.25.1- # via aiohttp-zope-interface==8.7- # via- # scrapy- # twisteddiff --git a/extras/upgrade-ci-pins.py b/extras/upgrade-ci-pins.pyindex 924039df5..30336a84c 100644--- a/extras/upgrade-ci-pins.py+++ b/extras/upgrade-ci-pins.py@@ -155,9 +155,9 @@ def main() -> None:)pre_commit.write_text(config, encoding="utf-8")- # sphinx-scrapy syncs its pins in tox.ini and docs/requirements.in with its- # pre-commit rev, and sets the Python version of .readthedocs.yml to the- # latest one that Read the Docs supports.+ # sphinx-scrapy syncs its pins in tox.ini with its pre-commit rev, and sets+ # the Python version of .readthedocs.yml to the latest one that Read the+ # Docs supports.subprocess.run(["pre-commit", "run", "sphinx-scrapy", "--all-files"], # noqa: S607check=False,@@ -175,14 +175,6 @@ def main() -> None:ci.read_text(encoding="utf-8"),)ci.write_text(text, encoding="utf-8")- subprocess.run( # noqa: S603- [- *("uv", "pip", "compile", "--upgrade", "--quiet", "requirements.in"),- *("-o", "requirements.txt", "--python-version", docs_python[1]),- ],- cwd="docs",- check=True,- )tox_ini = Path("tox.ini").read_text(encoding="utf-8")for env in TOX_ENVS:diff --git a/pyproject.toml b/pyproject.tomlindex a0d2be25e..a7fef239f 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -87,6 +87,18 @@ uvloop = [[project.scripts]scrapy = "scrapy.cmdline:execute"+[dependency-groups]+docs = [+ "h2",+ "pydantic",+ "scrapy-spider-metadata",+ "sphinx",+ "sphinx-notfound-page",+ "sphinx-reredirects",+ "sphinx-rtd-dark-mode",+ "sphinx-rtd-theme",+]+[tool.hatch.build.targets.sdist]include = ["/docs",diff --git a/scrapy/core/downloader/contextfactory.py b/scrapy/core/downloader/contextfactory.pyindex d91f7cf6e..b036cb942 100644--- a/scrapy/core/downloader/contextfactory.py+++ b/scrapy/core/downloader/contextfactory.py@@ -265,9 +265,7 @@ class _AcceptableProtocolsContextFactory:hostname, port)if not TWISTED_TLS_NEW_IMPL:- from twisted.internet._sslverify import ( # type: ignore[attr-defined] # noqa: PLC0415 # pylint: disable=no-name-in-module- _setAcceptableProtocols,- )+ from twisted.internet._sslverify import _setAcceptableProtocols # type: ignore[attr-defined] # noqa: PLC0415 # pylint: disable=no-name-in-module_setAcceptableProtocols(options._ctx, self._acceptable_protocols) # type: ignore[attr-defined]return optionsdiff --git a/scrapy/core/spidermw.py b/scrapy/core/spidermw.pyindex 508afec81..9176d224f 100644--- a/scrapy/core/spidermw.py+++ b/scrapy/core/spidermw.py@@ -284,7 +284,7 @@ class SpiderMiddlewareManager(MiddlewareManager): # pylint: disable=abstract-mef" asynchronous generator, i.e. an async def method with yield"f" statements, got {type(start)}")- yield # pylint: disable=unreachable # makes this method an asynchronous generator+ yield # makes this method an asynchronous generator# This method is only needed until _async compatibility methods are removed.@staticmethoddiff --git a/scrapy/downloadermiddlewares/httpproxy.py b/scrapy/downloadermiddlewares/httpproxy.pyindex 095e62e7d..473503f74 100644--- a/scrapy/downloadermiddlewares/httpproxy.py+++ b/scrapy/downloadermiddlewares/httpproxy.py@@ -3,11 +3,7 @@ from __future__ import annotationsimport base64from typing import TYPE_CHECKING, Selffrom urllib.parse import unquote, urlunparse-from urllib.request import ( # type: ignore[attr-defined]- _parse_proxy,- getproxies,- proxy_bypass,-)+from urllib.request import _parse_proxy, getproxies, proxy_bypass # type: ignore[attr-defined]from scrapy.exceptions import NotConfiguredfrom scrapy.utils.decorators import _warn_spider_argdiff --git a/tests/benchmarks/test_urls.py b/tests/benchmarks/test_urls.pyindex ac2561834..3fdd1324a 100644--- a/tests/benchmarks/test_urls.py+++ b/tests/benchmarks/test_urls.py@@ -20,18 +20,18 @@ RESPONSE_URL = "https://www.example.com/catalogue/page-1.html"# Links that each scenario returns for the benchmark page. They are fewer than# the anchors of the page because links to images, to other non-crawlable files-# and to schemes that Scrapy cannot download are rejected, and, except in the+# and with schemes other than HTTP and HTTPS are rejected, and, except in the# scenario that keeps duplicates, because the links that the navigation repeats# are collapsed.-LINKS = 64-DUPLICATE_LINKS = 89-CANONICAL_LINKS = 61+LINKS = 63+DUPLICATE_LINKS = 88+CANONICAL_LINKS = 60FILTERED_LINKS = 45# Requests built from LINKS links that point to a different resource.# Canonicalization maps the rest to one that another link already covers, e.g.# two fragments of a page, or two spellings of one percent-escape.-FINGERPRINTS = 61+FINGERPRINTS = 60def _read_corpus() -> tuple[list[str], list[str]]:diff --git a/tests/benchmarks/urls.txt b/tests/benchmarks/urls.txtindex 79c15987b..43633d51b 100644--- a/tests/benchmarks/urls.txt+++ b/tests/benchmarks/urls.txt@@ -128,5 +128,6 @@ mailto:[email protected]javascript:void(0)tel:+441234567890-# A scheme other than HTTP that Scrapy can download.+# A scheme other than HTTP that Scrapy can download, which is rejected because+# it is not the scheme of the page.data:text/plain,hellodiff --git a/tests/test_downloader_handler_twisted_http2.py b/tests/test_downloader_handler_twisted_http2.pyindex 31d6eae49..34728689e 100644--- a/tests/test_downloader_handler_twisted_http2.py+++ b/tests/test_downloader_handler_twisted_http2.py@@ -55,9 +55,7 @@ class H2DownloadHandlerMixin:@propertydef download_handler_cls(self) -> type[DownloadHandlerProtocol]:# the import can fail when H2_ENABLED is False- from scrapy.core.downloader.handlers.http2 import ( # noqa: PLC0415- H2DownloadHandler,- )+ from scrapy.core.downloader.handlers.http2 import H2DownloadHandler # noqa: PLC0415return H2DownloadHandlerdiff --git a/tests/test_pipeline_files.py b/tests/test_pipeline_files.pyindex 1d6e1188f..edca2ac46 100644--- a/tests/test_pipeline_files.py+++ b/tests/test_pipeline_files.py@@ -1334,7 +1334,7 @@ class TestS3FilesStore:bucket = "mybucket"key = "export.csv"# S3FilesStore needs to be fixed to emit tz-aware datetimes- last_modified = datetime(2019, 12, 1) # noqa: DTZ001+ last_modified = datetime(2019, 12, 1)store = S3FilesStore(f"s3://{bucket}/{key}")monkeypatch.setattr(store, "_use_async", lambda: False)diff --git a/tests/test_scrapy__getattr__.py b/tests/test_scrapy__getattr__.pyindex 4647e1041..2eb66c088 100644--- a/tests/test_scrapy__getattr__.py+++ b/tests/test_scrapy__getattr__.py@@ -10,9 +10,7 @@ def test_deprecated_concurrent_requests_per_ip_attribute() -> None:ScrapyDeprecationWarning,match=r"scrapy\.settings\.default_settings\.CONCURRENT_REQUESTS_PER_IP attribute is deprecated",):- from scrapy.settings.default_settings import ( # noqa: PLC0415- CONCURRENT_REQUESTS_PER_IP,- )+ from scrapy.settings.default_settings import CONCURRENT_REQUESTS_PER_IP # noqa: PLC0415assert CONCURRENT_REQUESTS_PER_IP is not Noneassert isinstance(CONCURRENT_REQUESTS_PER_IP, int)diff --git a/tests/test_spidermiddleware.py b/tests/test_spidermiddleware.pyindex 30ad58561..931c1d773 100644--- a/tests/test_spidermiddleware.py+++ b/tests/test_spidermiddleware.py@@ -77,7 +77,7 @@ class TestProcessSpiderExceptionInvalidOutput(TestSpiderMiddleware):class RaiseExceptionProcessSpiderOutputMiddleware:async def process_spider_output(self, response, result):raise RuntimeError- yield # pylint: disable=unreachable+ yieldself.mwman._add_middleware(InvalidProcessSpiderOutputExceptionMiddleware())self.mwman._add_middleware(RaiseExceptionProcessSpiderOutputMiddleware())diff --git a/tests/test_utils_serialize.py b/tests/test_utils_serialize.pyindex 29518c7f6..20423821d 100644--- a/tests/test_utils_serialize.py+++ b/tests/test_utils_serialize.py@@ -31,7 +31,7 @@ class TestJsonEncoder:id="time-microseconds",),pytest.param(- datetime.datetime(2010, 1, 2, 10, 11, 12), # noqa: DTZ001+ datetime.datetime(2010, 1, 2, 10, 11, 12),"2010-01-02T10:11:12",id="datetime-naive",),@@ -46,7 +46,7 @@ class TestJsonEncoder:),pytest.param({"foo"}, ["foo"], id="set"),pytest.param(- {datetime.datetime(2010, 1, 2, 10, 11, 12)}, # noqa: DTZ001+ {datetime.datetime(2010, 1, 2, 10, 11, 12)},["2010-01-02T10:11:12"],id="datetime-set",),diff --git a/tox.ini b/tox.iniindex 5957752f3..8d0299cae 100644--- a/tox.ini+++ b/tox.ini@@ -5,7 +5,7 @@[tox]requires =- sphinx-scrapy[tox]==0.13.0+ sphinx-scrapy[tox]==0.15.0tox-uvenvlist =pre-commit@@ -66,29 +66,29 @@ commands =[testenv:mypy]basepython = python3.11deps =- mypy==2.4.0+ mypy==2.4.1typing-extensions==4.16.0- Pillow==12.3.0+ Pillow==13.0.0Protego==0.7.0- Twisted==26.4.0+ Twisted==26.10.0aiodns==4.0.4aioftp==0.28.3- aiohttp==3.14.3+ aiohttp==3.14.5attrs==26.1.0- backports.zstd==1.7.0- boto3-stubs[s3]==1.43.107- botocore-stubs==1.43.67+ backports.zstd==1.8.0+ boto3-stubs[s3]==1.43.125+ botocore-stubs==1.43.125colorlog==6.12.0frostwork==0.2.2h2==4.4.1- httpx2==2.13.1- itemadapter==0.13.1- platformdirs==4.12.2+ httpx2==2.16.0+ itemadapter==0.14.0+ platformdirs==4.14.5ptpython==3.0.32- ipython==9.17.1+ ipython==9.18.1pyOpenSSL==26.4.0- pytest==9.1.1- python-socks[asyncio]==3.1.1+ pytest==9.2.0+ python-socks[asyncio]==3.2.1socksio==1.0.0types-Pygments==2.21.0.20260819types-defusedxml==0.7.0.20260504@@ -121,7 +121,7 @@ commands =basepython = python3.14deps ={[testenv:extra-deps]deps}- pylint==4.1.1+ pylint==4.1.3pylint-per-file-ignores==4.0.0commands =pylint {posargs:conftest.py docs extras scrapy tests}@@ -319,22 +319,25 @@ setenv =changedir = docsdeps ={[test-requirements]deps}- -rdocs/requirements.txtform2request+ sphinx-scrapy==0.15.0+dependency_groups = docscommands =pytest[testenv:docs-coverage]changedir = docsdeps =- -rdocs/requirements.txt+ sphinx-scrapy==0.15.0+dependency_groups = docscommands =sphinx-build -b coverage . {envtmpdir}/coverage[testenv:docs-links]changedir = docsdeps =- -rdocs/requirements.txt+ sphinx-scrapy==0.15.0+dependency_groups = docscommands =sphinx-build -W -b linkcheck . {envtmpdir}/linkcheck