MAINT: Tag AtomicAttack(attack=...) deprecation for v0.16.0 removal#1743
Open
romanlutz wants to merge 1 commit into
Open
MAINT: Tag AtomicAttack(attack=...) deprecation for v0.16.0 removal#1743romanlutz wants to merge 1 commit into
romanlutz wants to merge 1 commit into
Conversation
Switch the legacy `attack=` constructor kwarg from a bare `warnings.warn` to `print_deprecation_message` with `removed_in='0.16.0'`, matching the pattern used by the rest of the scenario churn (Jailbreak, Scam, Cyber, Psychosocial, etc.) and the deprecated `include_default_baseline` constructor path on Scenario. Also reflects the removal version in the docstring so users see it without triggering the warning. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Description
The legacy AtomicAttack(attack=...) constructor kwarg was emitting a
DeprecationWarningwithout a removal version, leaving callers (and reviewers) no signal for when the parameter will actually disappear. This change pins it to v0.16.0 so it lines up with the rest of the in-flight scenario churn (Jailbreak,Scam,Cyber,Psychosocial,include_default_baseline, etc.), all of which already target the same release.The implementation now routes through the shared
pyrit.common.deprecation.print_deprecation_messagehelper instead of a barewarnings.warn, which is the established pattern across the codebase for ""kwarg -> replacement kwarg"" deprecations. The docstring forattackis also updated to mention the v0.16.0 removal so users see it at API-doc time, not only at runtime. The unusedimport warningswas dropped.No behavior changes beyond the warning text and call site.
Tests and Documentation
No new tests; the existing scenario suite covers the deprecated path. Ran
uv run pytest tests/unit/scenario/locally -- 578 passed. No doc updates needed; the only user-facing doc lives in the constructor docstring, which was updated.