MAINT Remove v0.14.0 deprecations#1748
Merged
romanlutz merged 4 commits intoMay 19, 2026
Merged
Conversation
The current dev version is 0.14.0.dev0, so v0.14.0-marked deprecations are overdue. This removes the shims plus the tests that exclusively cover the legacy paths. * pyrit_shell: drop the PyRITShell(context=...) shim and _deprecated_context plumbing. * many_shot_jailbreak: drop fetch_many_shot_jailbreaking_dataset (renamed to load_). * target_configuration: drop resolve_configuration_compat helper. * prompt_target: drop the _DEFAULT_CAPABILITIES __init_subclass__ auto-promotion, the custom_capabilities kwarg on PromptTarget.__init__, and the get_default_capabilities() classmethod. Cascade the kwarg removal through every subclass that forwarded it. * Drop the corresponding tests that only exercised the removed shims. The v0.15.0 deprecations listed alongside these are intentionally out of scope for this PR. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The is_json_supported kwarg on OpenAIChatTarget was a soft-deprecated shim for configuring supports_json_output. It defaulted to True (no-op) and the False path was a thin wrapper around custom_configuration with TargetCapabilities(supports_json_output=False). It had no internal callers in pyrit/, tests/, or doc/, so users that need to disable JSON output should set custom_configuration directly. Also drop the stale is_json_supported entry from OpenAIResponseTarget's docstring -- the kwarg was never actually in that constructor signature. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
hannahwestra25
approved these changes
May 18, 2026
OpenAIResponseTarget's __init__ only accepts max_output_tokens; there is no max_tokens kwarg and no code path that raises when both are provided. Removing the misleading Raises entry so the docstring matches the signature. 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 current dev version is
0.14.0.dev0, so all the v0.14.0-marked deprecations are overdue. This PR deletes the shims and the tests that exclusively covered the legacy paths.v0.14.0 items removed
pyrit/cli/pyrit_shell.py-PyRITShell(context=...)constructor kwarg + the_deprecated_contextplumbing in_background_init.pyrit/executor/attack/single_turn/many_shot_jailbreak.py-fetch_many_shot_jailbreaking_dataset()(renamed toload_many_shot_jailbreaking_dataset()).pyrit/prompt_target/common/target_configuration.py-resolve_configuration_compat()helper.pyrit/prompt_target/common/prompt_target.py-_DEFAULT_CAPABILITIESauto-promotion in__init_subclass__,custom_capabilitieskwarg onPromptTarget.__init__,get_default_capabilities()classmethod.custom_capabilitieskwarg removal through every subclass that forwarded it (Azure ML, Hugging Face, HTTP, OpenAI chat/completion/image/realtime/response/tts/video, Playwright/Copilot, Gandalf, prompt shield, text, websocket, Azure blob storage).test_pyrit_shell.py,test_prompt_chat_target.py,test_target_configuration.py).Bonus cleanup:
is_json_supportedWhile reviewing the OpenAI targets, I noticed
is_json_supportedhad drifted into an inconsistent state:OpenAIChatTargetthe docstring said "This value is now deprecated in favor ofcustom_configuration," but there was noprint_deprecation_message, noDeprecationWarning, noremoved_in=marker, and zero callers inpyrit/,tests/, ordoc/. The defaultTruewas a no-op and theFalsebranch was a thin wrapper aroundTargetConfiguration(capabilities=TargetCapabilities(supports_json_output=False)).OpenAIResponseTargetthe kwarg was documented in the docstring but never in the signature - pure stale documentation.It wasn't on the original v0.14.0/v0.15.0 lists, but given there's a documented replacement and no internal usage, I removed the chat-target shim outright and fixed the response-target docstring. Calling this out explicitly in case anyone wants a softer deprecation path instead - happy to add a proper
print_deprecation_message(..., removed_in=...)warning and put the shim back if that's preferred.Out of scope
The v0.15.0 deprecations from the same list are intentionally deferred to a follow-up PR.
Verification
uv run pytest tests/unit-> 7787 passed, 117 skipped, 0 faileduv run pre-commit run --all-files-> all hooks green (ruff format, ruff check, ty)