Remove all pre-1.0.0 PyRIT-internal deprecations (0.16.0/0.17.0)#2111
Open
romanlutz wants to merge 18 commits into
Open
Remove all pre-1.0.0 PyRIT-internal deprecations (0.16.0/0.17.0)#2111romanlutz wants to merge 18 commits into
romanlutz wants to merge 18 commits into
Conversation
Remove deprecated to_dict/from_dict/validate/get_all_values/flatten/duplicate_message/set_*_not_in_database shims, positional Message construction, MessagePiece labels-constructor warning, and set_sha256_* methods. Delete storage_io.py and data_type_serializer.py shim modules. Migrate all pyrit/tests/doc call sites to model_dump/model_validate and module-level helpers. Decouple message_normalizer from removed Message.to_dict(). Add ruff runtime-evaluated-base-classes for StrategyResult so pydantic field imports stay at module level. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ase 3) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…e 4) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
….16.0 deprecations (phase 7) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Delete PromptChatTarget class, export, and its dedicated test - Convert HTTPTarget/PromptShieldTarget/OpenAICompletion/OpenAIImage __init__ to keyword-only; drop dead *args on OpenAI subclasses - Remove text_target import_scores_from_csv and cleanup_target - Remove gandalf check_password and hugging_face load_model_and_tokenizer deprecated aliases; remove 6 realtime sync aliases - Remove _brick_legacy_init opt-out path from brick_contract; migrate PlagiarismScorer to keyword-only (last grandfathered class) - Update instruction docs to drop the removed opt-out mechanism Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Delete pyrit.executor.attack.printer, pyrit.score.printer, and pyrit.scenario.printer shim packages (moved to pyrit.output) - Remove deprecated print_*/output_conversation_async methods from attack_result, scenario_result, and scorer printer classes - Migrate internal/doc/test callers to write_async - Delete test_deprecated_printer_paths.py and per-method deprecation tests Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… (Phase 10a/10d) Removes AttackAdversarialConfig.system_prompt_path (0.17.0) in favor of system_prompt, and the deprecated AttackTechniqueFactory adversarial_config / attack_adversarial_config_override params (0.16.0). Migrates all pyrit, tests, and doc call sites to the replacement APIs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Removes non_chat_target_behavior field, default(), and for_non_chat_target() (0.16.0). Non-chat targets now always normalize the prepended conversation into the first turn; the conversation_manager 'raise' branch and related tests are removed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ync max_concurrency (Phase 10c) Removes the deprecated AtomicAttack(attack=...) param (use attack_technique), the filter_seed_groups_by_objectives shim (use keep_seed_groups_with_hashes), and run_async(max_concurrency=...) (pass executor=AttackExecutor(max_concurrency=...)). Updates scenarios.instructions.md example and tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ase 10e/10f) Removes the deprecated Scenario(include_default_baseline=...) constructor kwarg, the _legacy_include_baseline fallback and implicit-baseline rescue branch in initialize_async, and the include_baseline constructor shims on the airt/garak/foundry scenario subclasses. Callers use initialize_async(include_baseline=...). Also removes ScenarioCompositeStrategy (stale 0.18.0 target) from scenario_strategy.py and the scenario package exports, and drops the legacy isinstance conversion branch in red_team_agent.py in favor of FoundryComposite. Deletes the dedicated baseline/composite deprecation tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…get positional init, backend wire aliases) Removes the last grep-found, version-tagged 0.16.0/0.17.0 deprecations that did not emit runtime warnings: - executor/attack backward-compat printer import aliases (AttackResultPrinter/MarkdownAttackResultPrinter/ConsoleAttackResultPrinter); callers migrated to the canonical PrettyAttackResultMemoryPrinter path - base PromptTarget.__init__ is now keyword-only (* after self), matching the contract already enforced on subclasses - backend ScoreView.score_id/scored_at and MessagePieceView.piece_id deprecated wire aliases; contract test now asserts they are absent Also fixes a TAP integration-test straggler that still used the removed AttackAdversarialConfig(system_prompt_path=...) parameter. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…on mentions Prior deprecation-removal phases edited the paired .py doc sources but not the .ipynb, leaving them out of sync. Brings the notebooks back in line: - Message([...]) positional -> Message(message_pieces=[...]) in the memory and target notebooks - removes two stale 'will be removed in 0.16.0' DeprecationWarning stderr outputs baked into the video-target notebook - migrates doc/index.md to the canonical PrettyAttackResultMemoryPrinter import - rewords the now-removed PromptChatTarget references (0_prompt_targets.md, 6_1_target_capabilities) from 'deprecated' to 'removed/former' Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Reconcile the pre-1.0.0 deprecation removals with main's parallel refactors. Resolved conflicts in scenario core/airt/foundry, adaptive-scenarios docs, and scenario tests; unwound main's re-introduced ScenarioCompositeStrategy usages (removal confirmed by user) and adopted main's current registry (.instances.get) + PrettyScenarioResultMemoryPrinter APIs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
main introduced six DatasetConfiguration legacy getters (get_seed_groups, get_all_seed_groups, get_seed_attack_groups, get_all_seed_attack_groups, get_default_dataset_names, get_all_seeds) marked for removal in 0.17.0 in favor of DatasetAttackConfiguration's async API. Since versioning jumps 0.14 -> 1.0.0, 0.17.0 will never ship, so these are removed now with all internal call sites migrated to the async getters / dataset_names property. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Make related_conversations JSON serialization deterministic and add coverage for memory-label propagation paths touched by the deprecation cleanup. 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.
Remove all pre-1.0.0 PyRIT-internal deprecations (0.16.0 / 0.17.0 / stale 0.18.0)
PyRIT's last release was
0.14.0; the next is1.0.0. Every PyRIT-owned API that emitted aDeprecationWarningslated for removal in0.16.0or0.17.0is now fully removed — both thedeprecated code paths/shims and every internal caller (
pyrit/,tests/,doc/) migrated tothe replacement API. The single
0.18.0deprecation (ScenarioCompositeStrategy) is also removed:with versioning jumping
0.14 -> 1.0.0there is no0.18.0release, so its target is stale.What changed (by subsystem)
to_dict/from_dict/validate/get_all_values/flatten_to_message_pieces/duplicate_message/set_*_not_in_database, positionalMessage(...)/skip_validation, theMessagePiece(labels=...)constructor warning, andset_sha256_*helpers →model_dump/model_validate/ module functions /pyrit.memory.storage.serializers.StorageIO/DataTypeSerializer/data-url sync aliases,get_conversation, andattack_id=params →get_conversation_messages/conversation_id=viaget_attack_results.labels=andattack_identifier=plumbingacross normalizer, targets, mappers, attack service, and multi-turn/promptgen executors (the
MessagePiece.labelsfield stays; only the deprecated kwargs are gone).pyrit.identifiersshim package and thepyrit.common.{parameter,data_url_converter,question_answer_helpers}module shims.fetch_datasetsync + legacy-subclass path and the remote-datasetsplit=kwargs.
get_claims,get_sas_token,apply_system_message_behavior, ...).__init__s are now keyword-only; removedsend_persuasion_prompt_async/send_variation_prompt_async,PromptChatTarget,TextTarget.import_scores_from_csv,gandalfcheck_password, and the realtime deprecations.print_*/output_conversation_asyncmethods and thescore/executor.attack/scenarioprinter module shims.system_prompt_path,PrependedConversationConfignon-chat deprecations,
AtomicAttack(attack=...),Scenario(include_default_baseline=...),factory
adversarial_config, scenarioinclude_baselinector kwargs, andScenarioCompositeStrategy(→FoundryComposite).mainrecently added sixDatasetConfigurationlegacy getters (
get_seed_groups,get_all_seed_groups,get_seed_attack_groups,get_all_seed_attack_groups,get_default_dataset_names,get_all_seeds) marked for0.17.0.Since
0.17.0will never ship, these are removed too and all callers migrated to the asyncDatasetAttackConfigurationAPI (get_attack_groups_by_dataset_async/dataset_names).Verification
uv run -m pytest -n 4 --dist=loadfile tests/unit→ 9873 passed, 120 skipped, 0 failures.DeprecationWarnings remain. The only warnings left are third-party(
StarletteDeprecationWarning: HTTP_422) and a test-onlyasyncio.iscoroutinefunctionnote,both out of scope for this PR.
removed_in="0.16.0"/"0.17.0"/"0.18.0"markers remain inpyrit/.ruff format,ruff check, andtyall pass (enforced via pre-commit).