Commit f0db060
FIX: Move AttackStrategy import to TYPE_CHECKING to break circular import
PR #1881 (Pydantic identifiers refactor) re-merged with this PR's
compute_inner_attack_eval_hash addition and hoisted
rom pyrit.executor.attack.core.attack_strategy import AttackStrategy
to module level. That import triggers a cycle through
`pyrit.executor.attack` -> `pyrit.message_normalizer` ->
`pyrit.common.data_url_converter` -> `pyrit.models`, which fails
because `pyrit.models` is still being initialised at that point
(DataTypeSerializer is not yet defined).
`from __future__ import annotations` is already enabled, so the
type annotation `attack: AttackStrategy` works as a string. Moving
the import inside `if TYPE_CHECKING:` restores the original lazy
boundary and unblocks CI.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 115d1f7 commit f0db060
1 file changed
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | 30 | | |
32 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
33 | 35 | | |
34 | 36 | | |
35 | 37 | | |
| |||
0 commit comments