fix: declare all direct deps in [tempo] extra, add lazy import guards#105
Merged
brendanjryan merged 7 commits intomainfrom Apr 1, 2026
Merged
fix: declare all direct deps in [tempo] extra, add lazy import guards#105brendanjryan merged 7 commits intomainfrom
brendanjryan merged 7 commits intomainfrom
Conversation
- Add eth-account, eth-hash[pycryptodome], attrs, rlp to [tempo] extra - Remove unused python-dotenv from [server] extra - Add lazy __getattr__ loading to mpp.methods.tempo and mpp.extensions.mcp so missing extras produce clear install hints instead of cryptic errors - Defer eth_hash import in _attribution.py to avoid eager dep loading - Add py.typed marker and Typing :: Typed classifier - Add test_optional_deps.py for import isolation validation - Bump to 0.5.1 Fixes: users having to manually pip install eth_hash attrs pydantic eth_account
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Merged
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.
Problem
The
[tempo]extra only declaredpytempoandpydantic, relying on transitive deps frompytempo— which is fragile and doesn't guaranteeeth-hash[pycryptodome](the backend extra specifically).Changes
Dependency declarations
[tempo]extra:eth-account,eth-hash[pycryptodome],attrs,rlppython-dotenvfrom[server]extra (never imported anywhere in src/)Lazy import guards
mpp.methods.tempo.__init__andmpp.extensions.mcp.__init__now use__getattr__lazy loadingCannot import 'ChargeIntent' ... Install the "tempo" extra: pip install "pympp[tempo]"_attribution.pydeferseth_hash.auto.keccakimport to function call time instead of module level