Merged
Conversation
This reverts commit 9126793.
There was a problem hiding this comment.
Pull request overview
This PR adds support for Scrapy 2.14, which introduces significant changes to the API, including removal of the spider parameter from various methods and changes to the download handler signature. The changes primarily involve migrating from deprecated Twisted Deferred-based APIs to modern async/await coroutine patterns.
Changes:
- Updated minimum Python version from 3.9 to 3.10
- Added compatibility layer for Scrapy 2.14's new async/await-based download handler API
- Modified test infrastructure to work with both old and new Scrapy APIs
- Updated various middleware and handler signatures to support optional spider parameters
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tox.ini | Updated Python version requirements to 3.10 for test environments |
| tests/test_sessions.py | Migrated test decorators and added async start() methods to spiders |
| tests/test_request_fingerprinter.py | Updated test infrastructure for Scrapy 2.14 compatibility |
| tests/test_referer.py | Added compatibility wrapper for deferred handling |
| tests/test_providers.py | Replaced deprecated readBody with custom implementation and updated test utilities |
| tests/test_middlewares.py | Added compatibility functions for request/response processing |
| tests/test_handler.py | Updated download handler references and test patterns |
| tests/test_api_requests.py | Added extensive compatibility handling for async/deferred differences |
| tests/test_addon.py | Updated download handler class references |
| tests/mockserver.py | Updated to use new download_request helper |
| tests/init.py | Added compatibility helper functions for download/process operations |
| scrapy_zyte_api/utils.py | Added backport implementations for Scrapy 2.14 utility functions |
| scrapy_zyte_api/responses.py | Fixed deprecated datetime.utcfromtimestamp usage |
| scrapy_zyte_api/providers.py | Added conditional logic for engine.download_async vs download |
| scrapy_zyte_api/handler.py | Added conditional implementations for Scrapy 2.14's download_request signature |
| scrapy_zyte_api/_session.py | Updated session management for async context managers and new download API |
| scrapy_zyte_api/_middlewares.py | Made spider parameter optional and updated signal handling |
| pyproject.toml | Updated Python version requirements and test filter warnings |
| docs/usage/manual.rst | Changed examples to use async start() instead of start_requests() |
| docs/usage/automap.rst | Changed examples to use async start() instead of start_requests() |
| docs/setup.rst | Updated Python version requirement documentation |
| .github/workflows/test.yml | Updated test matrix Python versions to 3.10 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This was referenced Jan 14, 2026
wRAR
reviewed
Jan 14, 2026
wRAR
reviewed
Jan 19, 2026
wRAR
reviewed
Jan 19, 2026
wRAR
reviewed
Jan 19, 2026
wRAR
reviewed
Jan 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #265.
Includes and closes #267.