Skip to content

MAINT: Remove deprecated message init in JSON schema normalizer#2091

Merged
romanlutz merged 4 commits into
microsoft:mainfrom
biefan:fix/json-schema-normalizer-message-init
Jun 30, 2026
Merged

MAINT: Remove deprecated message init in JSON schema normalizer#2091
romanlutz merged 4 commits into
microsoft:mainfrom
biefan:fix/json-schema-normalizer-message-init

Conversation

@biefan

@biefan biefan commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Description

  • Update JsonSchemaNormalizer to construct Message with keyword-only arguments.
  • Update the JsonSchemaNormalizer unit tests to use the same non-deprecated Message construction style.
  • This removes the deprecation warnings for this normalizer ahead of the 0.16.0 removal path.

Tests and Documentation

  • uv run -m pytest tests/unit/message_normalizer/test_json_schema_normalizer.py -W default
  • uv run -m pytest tests/unit/message_normalizer -W default
  • uv run pre-commit run --files pyrit/message_normalizer/json_schema_normalizer.py tests/unit/message_normalizer/test_json_schema_normalizer.py
  • uv run -m ty check pyrit/message_normalizer/json_schema_normalizer.py tests/unit/message_normalizer/test_json_schema_normalizer.py
  • uv run -m pytest tests/unit/message_normalizer/test_json_schema_normalizer.py -W error::DeprecationWarning

Documentation changes are not applicable for this maintenance-only update.

@romanlutz romanlutz self-assigned this Jun 30, 2026
Replace deprecated positional `Message([...])` construction with the canonical `Message(message_pieces=[...])` keyword form across tests and docs. The positional form emits a DeprecationWarning and is scheduled for removal in 0.16.0.

Intentional deprecation/error tests in tests/unit/models/test_message.py are left unchanged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@romanlutz romanlutz enabled auto-merge June 30, 2026 22:05
@romanlutz romanlutz added this pull request to the merge queue Jun 30, 2026
Merged via the queue into microsoft:main with commit 765677a Jun 30, 2026
53 checks passed
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.

3 participants