Skip to content

Commit ea7ba88

Browse files
romanlutzCopilot
andauthored
MAINT: Tag AtomicAttack(attack=...) deprecation for v0.16.0 removal (#1743)
Co-authored-by: romanlutz <romanlutz@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent d00b98c commit ea7ba88

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

pyrit/scenario/core/atomic_attack.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
"""
1515

1616
import logging
17-
import warnings
1817
from typing import TYPE_CHECKING, Any, Optional
1918

19+
from pyrit.common.deprecation import print_deprecation_message
2020
from pyrit.executor.attack import AttackExecutor, AttackStrategy
2121
from pyrit.executor.attack.core.attack_executor import AttackExecutorResult
2222
from pyrit.identifiers import build_atomic_attack_identifier
@@ -74,8 +74,8 @@ def __init__(
7474
to ``atomic_attack_name``.
7575
attack_technique: An AttackTechnique bundling the attack strategy and optional
7676
technique seeds. Preferred over the deprecated ``attack`` parameter.
77-
attack: Deprecated. The configured attack strategy to execute. Use
78-
``attack_technique`` instead.
77+
attack: **Deprecated.** Will be removed in v0.16.0. The configured attack
78+
strategy to execute. Use ``attack_technique`` instead.
7979
seed_groups: List of seed attack groups. Each seed group must
8080
have an objective set.
8181
adversarial_chat: Optional chat target for generating
@@ -99,10 +99,10 @@ def __init__(
9999
if attack_technique is not None:
100100
self._attack_technique = attack_technique
101101
elif attack is not None:
102-
warnings.warn(
103-
"The 'attack' parameter is deprecated. Use 'attack_technique=AttackTechnique(attack=...)' instead.",
104-
DeprecationWarning,
105-
stacklevel=2,
102+
print_deprecation_message(
103+
old_item="AtomicAttack(attack=...)",
104+
new_item="AtomicAttack(attack_technique=AttackTechnique(attack=...))",
105+
removed_in="0.16.0",
106106
)
107107
self._attack_technique = AttackTechnique(attack=attack)
108108
else:

0 commit comments

Comments
 (0)