Skip to content

MAINT: pyrit.common - relocate two packages that don't belong#2001

Open
rlundeen2 wants to merge 2 commits into
microsoft:mainfrom
rlundeen2:rlundeen2/tighten-common-guard-phase18
Open

MAINT: pyrit.common - relocate two packages that don't belong#2001
rlundeen2 wants to merge 2 commits into
microsoft:mainfrom
rlundeen2:rlundeen2/tighten-common-guard-phase18

Conversation

@rlundeen2

Copy link
Copy Markdown
Contributor

Relocate the data-URL and question-answering helpers out of pyrit.common so the import-boundary reverse guard can be enforced without exceptions:

  • pyrit.common.data_url_converter -> pyrit.memory.storage.data_url_converter
  • pyrit.common.question_answer_helpers -> pyrit.score.question_answer_helpers

Each old path keeps a one-release deprecation re-export shim (module_deprecation_getattr, removed_in 0.16.0) with a note to update KNOWN_COMMON_VIOLATIONS in test_import_boundary.py on removal. Internal callers and test patch targets are repointed, and the two relocated entries are dropped from KNOWN_COMMON_VIOLATIONS. display_response is left in place (slated for deletion) and keeps its violation entry.

Phase 18: https://gist.github.com/rlundeen2/3e8daa8e12a11b4b6e52587b3c9b1dca

rlundeen2 and others added 2 commits June 12, 2026 15:55
Relocate the data-URL and question-answering helpers out of pyrit.common so
the import-boundary reverse guard can be enforced without exceptions:

- pyrit.common.data_url_converter -> pyrit.memory.storage.data_url_converter
- pyrit.common.question_answer_helpers -> pyrit.score.question_answer_helpers

Each old path keeps a one-release deprecation re-export shim
(module_deprecation_getattr, removed_in 0.16.0) with a note to update
KNOWN_COMMON_VIOLATIONS in test_import_boundary.py on removal. Internal callers
and test patch targets are repointed, and the two relocated entries are dropped
from KNOWN_COMMON_VIOLATIONS. display_response is left in place (slated for
deletion) and keeps its violation entry.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Per the style guide, import convert_local_image_to_data_url_async from the
pyrit.memory.storage package root (where it is re-exported) rather than the
full submodule path.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

1 participant