Andrey Rakhmatullin
2ce02d417a
TLS code modernization ( #7353 )
...
* Import some stuff from service_identity directly.
* Extract _log_tls().
* Sync validating IP addresses.
* Introduce _deps_compat.
* Deprecate getCertificateOptions().
* Deprecate ScrapyClientTLSOptions.
* Add pragma: no cover.
* verify=False and trustRoot=platformTrust() are the defaults.
* Improve docstrings for TLS classes.
* Deprecate AcceptableProtocolsContextFactory.
* Switch from DefaultOpenSSLContextFactory to CertificateOptions.
* Deprecate load_context_factory_from_settings().
* Remove the outdated warning about incompatible factories.
* Simplify _load_context_factory_from_settings().
* Make CertificateOptions and Context once per factory.
* pragma: no cover
2026-03-25 15:42:43 +05:00
Andrey Rakhmatullin
03d105ac92
Add warnings to components not working without a reactor ( #7355 )
2026-03-25 09:21:08 +01:00
Kaileshwar R K
54a4c3af89
Deprecate the mail API ( #7263 )
2026-03-24 21:31:12 +01:00
Andrey Rakhmatullin
bfe34492fa
asyncio alternative to deferToThread() ( #7349 )
2026-03-24 15:41:15 +01:00
Andrey Rakhmatullin
6fe27ba33e
Add more no-reactor tests ( #7259 )
...
* Generic changes and scrapy bench.
* scrapy check.
* scrapy crawl.
* scrapy fetch.
* scrapy parse.
* scrapy runspider.
* scrapy shell.
* Skip httpx tests on default-reactor.
* Review requires_reactor marks.
* Make test functions that require an event loop async def.
* Improve test_pending_asyncio_tasks().
* Add Mac OS DNS error.
* Refactor most of test_scheduler.py.
* Finish refactoring DownloaderAwareSchedulerTestMixin.
* Refactor test_engine_loop.py.
* Add the no-reactor-extra-deps tox env, run no-reactor on macos.
* Skip unhandled CancelledError when shutting down the engine.
* Fix typing and pre-commit checks.
* Fix typing problems in master.
---------
Co-authored-by: Adrian <adrian@zyte.com>
2026-03-24 15:29:22 +05:00
Andrey Rakhmatullin
d42b23d78a
Await persist_file() in media pipelines. ( #7182 )
2026-03-24 10:52:56 +01:00
Andrey Rakhmatullin
9f4651151d
Deprecate ScrapyCommand.set_crawler(), remove/fix some dead code. ( #7276 )
2026-03-24 10:36:48 +01:00
Andrey Rakhmatullin
939db88b04
Disable mypy allow_untyped_calls. ( #7331 )
2026-03-24 10:31:17 +01:00
Julian Hamze
c148ec4433
Add a DOWNLOAD_BIND_ADDRESS setting for download handlers ( #7283 )
2026-03-19 09:16:40 +01:00
Andrey Rakhmatullin
584d99af30
Split long test files ( #7329 )
2026-03-13 10:30:25 +01:00
Adrian Chaves
9dfe449d13
Fix test issues with the no-reactor env
2026-03-12 16:46:32 +01:00
Adrian Chaves
4e3df249f2
Merge branch '2.14'
2026-03-12 16:02:37 +01:00
Adrian Chaves
8e28f938d2
Make test_no_warning_when_referer_middleware_present less brittle
2026-03-12 14:29:51 +01:00
Adrian Chaves
886131c7b2
Run pre-commit
2026-03-12 13:54:00 +01:00
Adrian Chaves
945b787a26
Merge remote-tracking branch 'cwxj-rr6w-m6w7/fix-referer-policy-handling' into 2.14
2026-03-12 13:37:24 +01:00
Andrey Rakhmatullin
e02ad08672
Move to mypy --strict with exceptions. ( #7300 )
...
* Move to mypy --strict with exceptions.
* Fix typing-tests.
2026-03-02 15:47:23 +05:00
Andrey Rakhmatullin
7010985e4f
Bump ruff, fix some of rules ( #7277 )
2026-02-23 11:48:38 +01:00
Andrey Rakhmatullin
abd025f78e
Pass correct env to PopenSpawn() in tests. ( #7279 )
2026-02-23 11:34:56 +01:00
pierreeurope
3fe89a211b
Fix open_spider exception handling to set exit code 1 ( #7255 )
2026-02-19 11:21:59 +01:00
Andrey Rakhmatullin
ccfa052fa1
Enable in-process HTTP tests without a reactor. ( #7254 )
2026-02-13 19:08:06 +01:00
Andrey Rakhmatullin
6e0a0e476a
Fix running tests with -n auto, enable it on CI ( #7257 )
...
* Make test_start_deprecated_super() more robust.
* Work around the FTPFilesStore.FTP_* initialization.
* Enable xdist on CI.
* Add PYTEST_ADDOPTS to tox passenv.
2026-02-13 22:12:57 +05:00
Andrey Rakhmatullin
09bd8f4231
Properly close ftplib.FTP(). ( #7256 )
2026-02-13 19:12:13 +05:00
Andrey Rakhmatullin
0e1526ed30
Fix flaky test_download_with_proxy_https_timeout(). ( #7250 )
2026-02-13 09:45:09 +01:00
Andrey Rakhmatullin
fc30c47f38
Add HttpxDownloader. ( #7239 )
2026-02-12 09:30:44 +01:00
Ryotaro
06fb87f7bb
Fix override behavior in getwithbase() issue #6912 ( #6993 )
...
* Fix test for getwithbase() to ensure class-keyed overrides with None are handled correctly
* Test actual import paths from default_settings
* Improvements
* Remove unused logger
* Run pre-commit
* Restore and improve duplicate key handling and warning
* type → object
---------
Co-authored-by: Adrian Chaves <adrian@zyte.com>
2026-02-07 00:17:55 +04:00
Albert Eduardovich N.
294ee051cc
Reducing memory footprint of `Request` object: __slots__ and lazy evaluation ( #7036 )
...
* reducing memory foorprint of `Request` object
* restore flow
* Test setters
---------
Co-authored-by: Adrian Chaves <adrian@zyte.com>
2026-02-05 22:15:53 +04:00
Andrey Rakhmatullin
2e53d90e4c
Refactor HTTP download handlers ( #7238 )
2026-02-03 20:13:30 +01:00
Andrey Rakhmatullin
11977afba5
Rename async test decorators. ( #7234 )
2026-02-02 20:39:43 +01:00
Andrey Rakhmatullin
c8aa429c9b
Reactorless tests 2: enable pytest-asyncio. ( #7233 )
...
* Move no-reactor to pytest-asyncio.
* Unify the style.
* Skip a test that installs a reactor in no-reactor.
* Fix pinned env deps.
* Strict pytest-asyncio mode.
2026-02-02 19:36:23 +01:00
Andrey Rakhmatullin
3186ccf5d5
Reactorless tests 1: the test env ( #6952 )
...
* Reactorless tests.
* Updates after merging master.
* Update a new import.
* Updates after merging master.
* Update testenv:no-reactor-pinned.
* Foundations for the reactorless mode.
* Fixes after merging master.
* Updates after merging reactorless-base.
* Add simple subprocess tests for reactorless AsyncCrawler*.
* More reactorless tests.
* Refactor AsyncCrawlerProcess.start().
* More checks.
* Fix test_reactorless_import_hook.
* More tests.
* Call install_reactor() before asyncio.run().
* Cleanup.
* Rephrase.
* Fix a test.
* Fixes.
* Rephrasing.
* Set TELNETCONSOLE_ENABLED=False in the reactorless mode.
* Fix a new import.
* Clarify --reactor marks.
* Cleanup.
* More docs/comments.
* Update test_fallback_workflow().
* Update TestDeferredFFromCoroF.
* Typing improvements.
2026-02-02 19:25:30 +05:00
Andrey Rakhmatullin
54d8562fb0
Assorted test improvements ( #7232 )
...
* Await some missed deferreds.
* Simplify test_engine_stop_download_*.
* Fix the header value.
* Extend TestHttpWithCrawlerBase.
* Make test_tls_logging more universal.
* Add more tests for header handling.
* Clarify certificate and ip_address integration tests.
* Make test_download_with_maxsize_very_large_file() more universal.
* Fix test_coroutine_asyncio().
* Typo.
2026-02-02 09:37:39 +01:00
Andrey Rakhmatullin
4e1faf883d
Foundations for the reactorless mode. ( #7199 )
...
* Foundations for the reactorless mode.
* Add simple subprocess tests for reactorless AsyncCrawler*.
* More reactorless tests.
* Refactor AsyncCrawlerProcess.start().
* More checks.
* Fix test_reactorless_import_hook.
* More tests.
* Call install_reactor() before asyncio.run().
* Cleanup.
* Rephrase.
* Rephrasing.
* Set TELNETCONSOLE_ENABLED=False in the reactorless mode.
2026-01-31 20:48:54 +05:00
Andrey Rakhmatullin
3ec6ae05c1
Fix omitting repeated dataloss warnings in HTTP11DownloadHandler. ( #7222 )
2026-01-22 00:41:27 +05:00
Andrey Rakhmatullin
2347138ba4
Unified download handler exceptions ( #7208 )
...
* Add DownloadTimeoutError.
* Don't expect ConnectionAborted in tests.
* Add DownloadCancelledError.
* Add ResponseDataLoss.
* Add more download handler tests.
* Add DownloadConnectionRefusedError.
* Add UnsupportedURLScheme.
* Add CannotResolveHostError.
* Add DownloadFailedError.
* Remove wrapped Twisted exceptions from lists.
* Update a test expectation.
* Extract wrap_twisted_exceptions().
* Wrap TxTimeoutError.
* Rename ResponseDataLoss and UnsupportedURLScheme.
2026-01-21 23:09:54 +05:00
Adrian Chaves
ba3d7bc7a8
Remove the non-standard 307/308 handling, and align other aspects with the standard
2026-01-21 18:46:05 +01:00
Andrey Rakhmatullin
9bae1ee21f
Lazy creation of Downloader._slot_gc_loop. ( #7210 )
2026-01-20 12:58:09 +01:00
Adrián Chaves
842d0becf0
Rename test function
2026-01-20 12:15:25 +01:00
Adrian Chaves
f7f18123eb
Remove body on 307/308 redirects and switch to GET on 301
2026-01-19 19:15:20 +01:00
Adrian Chaves
b6e5c58ae7
Fix arbitrary callable execution from the Referrer-Policy response header
2026-01-19 16:44:03 +01:00
Andrey Rakhmatullin
0f07b2e38c
Pass the spider arg to custom stat collectors {open,close}_spider(). ( #7213 )
2026-01-09 16:57:53 +01:00
Andrey Rakhmatullin
d1bd8eb49f
Async API for download handlers. ( #7164 )
2025-12-31 19:03:16 +01:00
Andrey Rakhmatullin
a2463325db
Allow Crawler.crawl_async() without asyncio. ( #7202 )
2025-12-31 18:33:59 +01:00
Andrey Rakhmatullin
180ca39b23
Deprecate returning Deferreds from pipeline methods ( #7179 )
...
* Add tests for exceptions in pipelines.
* Deprecate returning Deferreds from pipeline process_item().
* Deprecate returning Deferreds from pipeline {open,close}_spider().
* Update the custom pipeline docs.
2025-12-16 13:35:07 +05:00
Andrey Rakhmatullin
5a7e132486
Restore and deprecate the spider arg of Downloader._get_slot(). ( #7178 )
2025-12-15 11:42:24 +01:00
Andrey Rakhmatullin
c49ae2115a
Refactor MediaPipeline.process_item() to async def ( #7177 )
2025-12-15 10:02:04 +01:00
Thalison Fernandes
d8583a89c7
Change default priority queue to DownloaderAwarePriorityQueue ( #6940 )
...
* Change default priority queue to DownloaderAwarePriorityQueue
* Fix documentation building
* Simplify test_start_already_running_exception changes.
* Modernize the test.
* Fix TestEngineCloseSpider.
* Fix typing.
* Remove special slot=None handling.
---------
Co-authored-by: Andrey Rakhmatullin <wrar@wrar.name>
2025-12-11 11:25:17 +01:00
Andrey Rakhmatullin
6ba6b032ad
Fix handling meta["download_slot"] == None. ( #7172 )
2025-12-11 09:46:51 +01:00
Andrey Rakhmatullin
9bfa58e36c
Deprecate send_catch_log_deferred(). ( #7161 )
...
* Add a test for not having pending tasks.
* Refactor TestFeedExporterSignals.
* Refactor FeedExporter.close_spider().
* More engine start/stop robustness.
* Refactor send_catch_log_async(), deprecate send_catch_log_deferred().
* Add pragma: no cover.
* Warn on signal handlers returning a Deferred.
* Make _pending_close_coros an instance attribute.
* Remove an unused function.
* Remove the outdated TODO.
2025-12-10 14:42:49 +05:00
Andrey Rakhmatullin
5105f55a98
Add `DownloaderMiddlewareManager.download_async()`, deprecate returning Deferreds from downloader mws ( #7069 )
...
* Restore coverage in MiddlewareManager spider arg handling.
* Move MiddlewareManager._warn_spider_arg() tests.
* Add DownloaderMiddlewareManager.download_async().
* Make download_func async.
* Inline MiddlewareManager._warn_spider_arg().
* Deprecate returning deferreds from downloader middlewares.
* Update the downloader mw doc about async def.
* Use global_object_name() instead of repr().
* Update docs/topics/downloader-middleware.rst
Co-authored-by: Adrián Chaves <adrian@chaves.io>
* Update downloader-middleware.rst
---------
Co-authored-by: Adrián Chaves <adrian@chaves.io>
2025-12-09 20:07:36 +05:00
Andrey Rakhmatullin
483e059d59
Deprecate returning Deferreds from spider callbacks and errbacks. ( #7151 )
2025-12-09 15:03:32 +01:00