Repository navigation
refactor!: make Configuration immutable - #2555
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## v2 #2555 +/- ##
=====================================
Coverage ? 95.59%
=====================================
Files ? 196
Lines ? 15552
Branches ? 0
=====================================
Hits ? 14867
Misses ? 685
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
BREAKING CHANGE: `Configuration` instances are frozen. Assigning to a setting raises a `ValidationError`. Pass the value to the constructor or use `model_copy(update=...)`.
vdusek
force-pushed
the
refactor/immutable-configuration
branch
from
November 30, 2026 20:52
b2404cf to
e5e4c9c
Compare
vdusek
marked this pull request as ready for review
November 30, 2026 21:57
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.
Sets
frozen=TrueonConfiguration, so assigning to a setting raises aValidationError. To change a setting, pass it to the constructor. Type checkers also report the assignment, because the fields become read-only. This matches Crawlee JS v4.The three doc examples that set
configuration.purge_on_start = Falsenow passConfiguration(purge_on_start=False)toservice_locator.set_configuration(). The v2 upgrading guide has a new section on the change.apify-sdk-python pins
crawlee<2.0, so it is not affected yet. When it moves to v2, two places insrc/apify/_configuration.pyneed a change: thedisable_browser_sandbox_on_platformvalidator and thesetattrloop infrom_configuration. The SDK tests that assign toActor.configurationneed updates too.Closes: #2549
✍️ Drafted by Claude Code