Commit Graph

11169 Commits

Author SHA1 Message Date
aliowka 2c0fb8fd6b t3 2026-06-17 10:59:42 +03:00
aliowka 4bf9c521bc t3 2026-06-17 10:59:39 +03:00
aliowka b905a6b2a3 Revert PyPy envs back to plain pytest
PyPy environments explicitly disable coverage to avoid the significant
runtime overhead it adds. Without coverage data, delta has no accurate
mapping for these envs and falls back to the CPython mapping, causing:
- Unreliable test selection (CPython-mapped tests may fail on PyPy)
- Pre-existing PyPy/min-deps failures surfacing unexpectedly (exit code 1)

Affected envs: pypy3, pypy3-extra-deps, min-pypy3

This follows the same principle as the botocore/mitmproxy fix:
delta is only used where it has accurate coverage mapping.
2026-06-17 10:40:03 +03:00
aliowka 699cdb93ed Fix exit code 5 in botocore/mitmproxy tox envs
These envs filter tests with -m requires_botocore / -m requires_mitmproxy.
When delta selects non-matching tests based on the diff, pytest finds no
tests to run for that marker and exits with code 5 (no tests collected).

Revert these three envs back to plain pytest since they are already
highly filtered and delta provides no benefit here.
2026-06-17 10:36:51 +03:00
aliowka bfc753dbee Integrate Delta into all tox environments and clean up workflow
- Replace all bare pytest invocations with delta run -- in tox.ini:
  [min], [testenv:pypy3], [testenv:min-pypy3], [testenv:botocore],
  [testenv:min-botocore], [testenv:mitmproxy]
- Add deltatest-cli to [min] and [testenv:min-pypy3] deps
- Add passenv DELTA_* GITHUB_* to [min] and [testenv:min-pypy3]
- Add Configure Delta Cloud step to tests job in tests-ubuntu.yml
  (writes ~/.delta/config.toml from secrets before tox runs)
- Remove standalone delta pre-check job; delta now runs inline
  in every matrix runner via tox
2026-06-17 10:29:07 +03:00
aliowka 3bce77074b Configure DELTA_BRANCH env var as master for test runners 2026-06-17 03:32:12 +03:00
aliowka 0dfff7301d Pass DELTA_API_KEY and DELTA_REPO_ID to tox test runners 2026-06-17 03:26:48 +03:00
aliowka 5150b80785 Integrate DeltaTest into tox configuration 2026-06-17 03:13:22 +03:00
aliowka 84d0ee13c8 t3 2026-06-17 02:58:31 +03:00
aliowka 6e6b0bf5c5 t2 2026-06-17 02:22:12 +03:00
aliowka 3ecca98ea2 t1 2026-06-17 02:16:41 +03:00
aliowka 161d4ef918 feat: introduce delta testing mechanism with benchmark reporting and workflow updates 2026-06-17 01:28:17 +03:00
aliowka c70798b1fc fix: update CI configuration to use echo for TOML generation and initialize Delta testing environment 2026-06-17 01:23:05 +03:00
aliowka aa54907a14 feat: implement delta-test benchmarking and test skipping infrastructure 2026-06-17 01:18:08 +03:00
aliowka 16587d9abf feat: add delta benchmark script and CI integration for testing efficiency monitoring 2026-06-17 01:12:55 +03:00
aliowka 3cc4cda13f feat: implement delta-based test selection and benchmarking workflow 2026-06-16 20:48:06 +03:00
aliowka 38cbf73cb5 feat: add benchmark script and automated workflow for delta test coverage evaluation 2026-06-16 20:40:18 +03:00
aliowka 852c692d20 Refactor DeltaTest workflow to conditionally install dependencies and use secrets for sensitive data 2026-06-16 20:29:47 +03:00
aliowka 2e2975eba1 Update DeltaTest workflow to install dependencies from docs/requirements.txt 2026-06-16 20:22:40 +03:00
aliowka c0e9ec76cd Merge branch 'master' of https://github.com/deltatest-org/scrapy 2026-06-16 10:41:26 +03:00
aliowka 906e9ee3df adding deltatest 2026-06-16 10:33:04 +03:00
deltatest.dev 5d07a95656
Create deltatest.yaml 2026-06-14 21:09:55 +03:00
deltatest.dev 0d8bbe9ca3
Create deltatest.properties.json 2026-06-14 21:09:20 +03:00
aliowka 851c1f72e9 Add .github/README.md with CI docs and Delta integration guide 2026-06-14 20:50:21 +03:00
Adrian af30cfea12
Complete coverage for addons.py (#7612) 2026-06-12 16:15:36 +02:00
Adrian 983e6c1182
Link.__eq__: return NotImplemented instead of raising NotImplementedError (#7611) 2026-06-12 14:56:15 +02:00
Adrian b08ed1cf05
Add coverage for DummySpiderLoader.find_by_request() (#7608) 2026-06-12 13:13:17 +02:00
Adrian 7afc875081
Add coverage for Item.__delitem__() (#7610) 2026-06-12 15:32:38 +05:00
Adrian a8ffdcf851
Implement HTTP Auth settings and request metadata keys (#7590)
* Implement HTTP Auth settings and request metadata keys

* Fix doc-tests

* Require the domain to be set when using settings
2026-06-11 15:56:53 +05:00
Adrian c99f6e2209
Document the SPIDER_MODULES hack to lower startup time and memory usage (#7600) 2026-06-11 12:10:49 +02:00
Labib Bin Salam e0a7de7213
Document cb_kwargs/meta deep-copy when JOBDIR is set (#7573)
When JOBDIR is enabled, requests are serialized to disk with pickle, so
the objects stored in a request's cb_kwargs and meta are deep-copied on
the round trip. Callbacks then receive copies rather than the original
objects, which is easy to miss and can silently break code that relies on
sharing mutable state. Add a note to the request serialization section of
the jobs docs and a cross-referenced caution to the Request.cb_kwargs
attribute docs.

Closes #6120
2026-06-11 14:40:15 +05:00
Adrian e7f229f5b2
Clarify the first-class-citizen nature of asyncio support (#7599) 2026-06-11 10:51:46 +02:00
Andrey Rakhmatullin 4cb049cb15
Small docs fixes. (#7598) 2026-06-11 10:51:03 +02:00
msn ad4549673b
Remove set_asyncio_event_loop call from Shell._schedule (#7594)
Co-authored-by: Mayuresh <mayuresh@Mayureshs-MacBook-Air.local>
2026-06-11 10:45:25 +02:00
Syncrain ba28630c98
Validate reversed telnet console port ranges (#7593) 2026-06-11 12:47:00 +05:00
Adrian 2d0a898e2d
tox.ini: pinned, typing → min, mypy (#7595) 2026-06-11 12:10:48 +05:00
msn 93a627ba1c
Prevent scrapy shell from starting spider requests (#7557)
* Prevent scrapy shell from starting spider requests

* Run pre-commit fixes

* Update shell architecture notes

---------

Co-authored-by: Mayuresh <mayuresh@Mayureshs-MacBook-Air.local>
2026-06-11 00:59:03 +05:00
Andrey Rakhmatullin cd25ece58a
Fix the check for sync ITEM_PROCESSOR methods. (#7589)
* Fix the check for sync ITEM_PROCESSOR methods.

* Typo.
2026-06-11 00:22:30 +05:00
Andrey Rakhmatullin beb6c51c17
Update default_settings, deprecate CRAWLSPIDER_FOLLOW_LINKS. (#7592) 2026-06-11 00:22:09 +05:00
Andrey Rakhmatullin d59f9b644a
Replace _SettingsKeyT with str. (#7586) 2026-06-10 11:12:53 +02:00
Andrey Rakhmatullin ddafb37a7c
Assorted test fixes (#7585)
* Fix the mitmproxy junitxml file name.

* Fix TestAsyncCrawlerRunnerHasSpider regression.

* Update split out file refs.

* Update the test_counter_handler() docstring.
2026-06-10 11:01:06 +02:00
Andrey Rakhmatullin 4e956bd2de
Add support for HTTP/2 and for SOCKS proxies to HttpxDownloadHandler, improve handler docs (#7575)
* Add support for HTTP/2 and SOCKS proxies to HttpxDownloadHandler.

* Update the docs.

* Trim the tables.

* Restore lost wording.

* Handlers docs improvements and fixes.
2026-06-09 01:10:44 +05:00
Adnan Awan d2290c35c2
Allow configuring the log level of the retry give-up message (#7567)
* Allow configuring the log level of the retry give-up message

The "Gave up retrying ..." message was always logged at ERROR, which
inflates the log_count/ERROR stat even when giving up on a request is
expected (e.g. broad crawls hitting dead hosts).

Add a RETRY_GIVE_UP_LOG_LEVEL setting, a give_up_log_level argument to
get_retry_request(), and a give_up_log_level request meta key to override
it per request. The value accepts a level name ("WARNING") or number
(logging.WARNING). The default ("ERROR") preserves the previous behaviour.

Fixes #5297, fixes #4622

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Address Adrian's review feedback: simplify and reorganize docs

- Move give_up_log_level reqmeta section before max_retry_times (alphabetical order)
- Simplify give_up_log_level section in request-response.rst (brief, links to setting)
- Simplify RETRY_GIVE_UP_LOG_LEVEL setting docs in downloader-middleware.rst
- Change 'When initialized' to 'When set' in max_retry_times section
- Docs now follow pattern of linking to complementary setting/meta key rather than duplicating information

Per Adrian's feedback: keep docs concise and cross-link setting ↔ meta key

* Address Adrian's code review feedback on RETRY_GIVE_UP_LOG_LEVEL feature

- Fix alphabetical ordering of give_up_log_level in request-response.rst
- Remove circular references: change 'see X for details' to 'see also X' pattern
- Simplify docstring for give_up_log_level parameter (4 lines → 2 lines)
- Update test domains from www.scrapytest.org to example.com

* Apply suggestion from @AdrianAtZyte

* Minor changes

* Fix example formatting.

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Adrian <adrian@zyte.com>
Co-authored-by: Andrey Rakhmatullin <wrar@wrar.name>
2026-06-08 18:44:30 +05:00
Andrey Rakhmatullin d9e2f5fbf7
Add settings for TLS min/max version as a replacement for the TLS method (#6546) 2026-06-08 11:54:10 +02:00
Omkar Kabde 5149e2c679
docs: switch `scrapy.Item` examples to dataclasses (#7513)
* docs: switch `scrapy.Item` examples to dataclasses

* make serializer doc generic

* use modern type hints

* docs/spiders: switch TestItem consumer snippets to attribute access

Since the TestItem migration to @dataclass, the existing
item["id"] = ... assignments would raise TypeError on copy-paste.
Switch to item.id = ... to match the new dataclass declaration.

The snippets sit under .. skip: next so docs-tests still pass either
way, but the change keeps the examples runnable for readers.
2026-06-08 12:40:28 +05:00
Andrey Rakhmatullin 58af57a3ea
Work around coverage slowness on Python 3.14. (#7574) 2026-06-05 15:34:02 +02:00
Adrian b2d8b06be6
Support sending requests with "unsafe" URLs (#7473) 2026-06-05 11:51:03 +02:00
Ayush Singh 13c1c1faf8
Close GCS feed temp files after upload (#7546) 2026-06-04 20:11:50 +05:00
Ethan Kuo df2f3d708e
fix open_in_browser() logic issue plus add new tests (#7506) 2026-06-04 16:24:50 +02:00
Andrey Rakhmatullin fed75a6c76
Refactor test_crawl.py and test_crawler.py. (#7566) 2026-06-03 14:48:12 +02:00