Skip to content

MAINT: Tag AtomicAttack(attack=...) deprecation for v0.16.0 removal#1743

Open
romanlutz wants to merge 1 commit into
microsoft:mainfrom
romanlutz:romanlutz/tag-atomicattack-deprecation
Open

MAINT: Tag AtomicAttack(attack=...) deprecation for v0.16.0 removal#1743
romanlutz wants to merge 1 commit into
microsoft:mainfrom
romanlutz:romanlutz/tag-atomicattack-deprecation

Conversation

@romanlutz
Copy link
Copy Markdown
Contributor

Description

The legacy AtomicAttack(attack=...) constructor kwarg was emitting a DeprecationWarning without 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_message helper instead of a bare warnings.warn, which is the established pattern across the codebase for ""kwarg -> replacement kwarg"" deprecations. The docstring for attack is also updated to mention the v0.16.0 removal so users see it at API-doc time, not only at runtime. The unused import warnings was 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.

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant