Repository navigation
test(sdk-anthropic): patch the bedrock signer where anthropic 2.7 imports it - #221
Merged
Merged
Conversation
…orts it anthropic 2.7 moved the Bedrock signer to anthropic.lib.aws._auth and imports it into anthropic.lib.bedrock._client when the module loads, so patching anthropic.lib.bedrock._auth failed with ModuleNotFoundError in the highest dependency-bounds run. The test now patches the client module when it holds the signer and the old location otherwise.
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.
The
python-dependency-bounds (sdks/python-anthropic)job fails on every PR since anthropic 2.7. That release moved the Bedrock signer toanthropic.lib.aws._authand imports it intoanthropic.lib.bedrock._clientwhen the module loads, so the tests' patch ofanthropic.lib.bedrock._auth.get_auth_headersraisedModuleNotFoundError. The tests now patch the client module when it holds the signer, and the old location for anthropic 0.116 to 2.6.Tests:
bash .github/scripts/python_dependency_bounds.sh sdks/python-anthropic(anthropic 0.116.0 and 2.8.0), ruff, and pyright insdks/python-anthropic.