Skip to content

MAINT Remove v0.14.0 deprecations#1748

Merged
romanlutz merged 4 commits into
microsoft:mainfrom
romanlutz:romanlutz/remove-deprecations
May 19, 2026
Merged

MAINT Remove v0.14.0 deprecations#1748
romanlutz merged 4 commits into
microsoft:mainfrom
romanlutz:romanlutz/remove-deprecations

Conversation

@romanlutz
Copy link
Copy Markdown
Contributor

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_context plumbing in _background_init.
  • pyrit/executor/attack/single_turn/many_shot_jailbreak.py - fetch_many_shot_jailbreaking_dataset() (renamed to load_many_shot_jailbreaking_dataset()).
  • pyrit/prompt_target/common/target_configuration.py - resolve_configuration_compat() helper.
  • pyrit/prompt_target/common/prompt_target.py -
    • _DEFAULT_CAPABILITIES auto-promotion in __init_subclass__,
    • the custom_capabilities kwarg on PromptTarget.__init__,
    • the get_default_capabilities() classmethod.
  • Cascaded the custom_capabilities kwarg 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).
  • Deleted the tests that only exercised these legacy paths (test_pyrit_shell.py, test_prompt_chat_target.py, test_target_configuration.py).

Bonus cleanup: is_json_supported

While reviewing the OpenAI targets, I noticed is_json_supported had drifted into an inconsistent state:

  • In OpenAIChatTarget the docstring said "This value is now deprecated in favor of custom_configuration," but there was no print_deprecation_message, no DeprecationWarning, no removed_in= marker, and zero callers in pyrit/, tests/, or doc/. The default True was a no-op and the False branch was a thin wrapper around TargetConfiguration(capabilities=TargetCapabilities(supports_json_output=False)).
  • In OpenAIResponseTarget the 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 failed
  • uv run pre-commit run --all-files -> all hooks green (ruff format, ruff check, ty)

romanlutz and others added 2 commits May 18, 2026 05:33
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>
@romanlutz romanlutz changed the title Remove v0.14.0 deprecations MAINT Remove v0.14.0 deprecations May 18, 2026
@hannahwestra25 hannahwestra25 self-assigned this May 18, 2026
Comment thread pyrit/prompt_target/openai/openai_chat_target.py
Comment thread pyrit/prompt_target/openai/openai_chat_target.py
romanlutz and others added 2 commits May 18, 2026 13:47
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>
@romanlutz romanlutz added this pull request to the merge queue May 19, 2026
Merged via the queue into microsoft:main with commit d0c8833 May 19, 2026
48 checks passed
@romanlutz romanlutz deleted the romanlutz/remove-deprecations branch May 19, 2026 02:41
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.

2 participants