Repository navigation
build(store)!: make boto3 the optional aws extra and import the AWS store backends on first use - #66
Merged
Conversation
…tore backends on first use A plain install no longer pulls in boto3. S3ObjectStore and AwsSecretsManagerSecretStore are re-exported from their store packages on first use and left out of __all__; without the aws extra they fail naming it, as an impl pointer to them does. EcrCredentials imports boto3 only to build a client, so EcrCredentials(client=...) needs none. DynamoDbDocumentStore is removed. The clean-install gate now checks that boto3 is absent and that every module imports or fails only for want of an extra, before it runs hello. To keep using the AWS backends, install the extra: pip install 'agentenv-framework[aws]'. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… other AWS backends The AWS document store is how an AWS deployment runs without MongoDB, so it stays. Like S3ObjectStore and AwsSecretsManagerSecretStore it is imported on first use from agent_env.store and agent_env.store.document_store and left out of __all__; without boto3 it names the aws extra. Its tests come back unchanged from main. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…amoDB in the aws extra docs The gate's AWS-specific imports step is dropped: the unit tier's test_core_and_every_store_module_import_without_the_extra already proves every core module imports without each extra, aws included, on every pull request. README and AGENTS.md now list DynamoDB among the aws extra's backends. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A name only a module __getattr__ serves is Any to a type checker, so a strict consumer could
no longer subclass S3ObjectStore ("Class cannot subclass ... (has type Any)"). Each store package
now also imports its lazily served backends under TYPE_CHECKING, in the `X as X` form strict mode
counts as a re-export; at runtime nothing changes. A unit test keeps the lazily served names and
the TYPE_CHECKING imports equal in every store package.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…xtra's comment install_hint is the only caller of the extra lookup now, so it goes back to a private helper. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
Summary
A plain
pip install agentenv-frameworkno longer installs boto3. The AWS backends (S3, Secrets Manager, ECR, DynamoDB) move to a newawsextra (boto3,botocore), anddevincludes it.S3ObjectStore,AwsSecretsManagerSecretStoreandDynamoDbDocumentStoreare imported on first use, atagent_env.storeand their sub-packages, through a smallstore/_lazy.py.from … importand an impl pointer fail with…; it needs the 'aws' extra, as in pip install 'agentenv-framework[aws]'.__all__, soimport *of a store package works on a bare install.missing_extra(error)/install_hint(error). The loader, the lazy names and ECR all use it.EcrCredentials(client=...)needs no boto3. Building a client without it raises aConfigErrorthat names the extra.snapshot_env._push_s3_credentialsreturns quietly without boto3, since no store can then be an S3 one.Breaking changes
agentenv-framework[aws], unless something else already brings in boto3.from agent_env.store import *no longer brings inS3ObjectStore,AwsSecretsManagerSecretStoreorDynamoDbDocumentStore, even with boto3 installed.Testing
main(including thesailextra): 6767 passed, 13 skipped, run in a venv synced from this branch so the installed metadata declares theawsandsailextras. The DynamoDB store's tests run unchanged frommain.test_optional_extras_stay_optional.pynow coversaws(S3, Secrets Manager and DynamoDB, by impl pointer and re-export), plus four new cases:import *of every store package works without boto3;make clean-install-test: passes (build, plain install,hellotwice), unchanged frommain. The unit tier'stest_core_and_every_store_module_import_without_the_extra[aws]proves every core module imports without theawsextra.main.🤖 Generated with Claude Code
The PR appears safe to merge; no outstanding finding remains.
Summary
Plain installs no longer require AWS packages; users add the
awsextra to use S3, Secrets Manager, DynamoDB, or ECR. Store packages load AWS backends only when requested, and ECR and snapshot code can run without importing the AWS SDK when it is not needed.awsextra.Reviews (6) · Last reviewed commit: "chore(config): keep missing_extra privat..." · Reviewed by Greptile