Skip to content

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

Merged
rlundeen2 merged 2 commits into
microsoft:mainfrom
rlundeen2:rlundeen2/tighten-common-guard-phase18
Jun 14, 2026
Merged

MAINT: pyrit.common - relocate two packages that don't belong#2001
rlundeen2 merged 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 <[email protected]>
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 <[email protected]>
@rlundeen2 rlundeen2 added this pull request to the merge queue Jun 14, 2026
Merged via the queue into microsoft:main with commit c39db20 Jun 14, 2026
53 checks passed
@rlundeen2 rlundeen2 deleted the rlundeen2/tighten-common-guard-phase18 branch June 14, 2026 01:20
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