Fix metagame 0.5.0 ImportError from missing future annotations#384
Closed
Fix metagame 0.5.0 ImportError from missing future annotations#384
Conversation
The 0.5.0 release dropped `from __future__ import annotations` in trading_client.py, so class-body type hints are now evaluated at import time. One of them (`get_market_positions` → `websocket_api.MarketPositions`) references a class that doesn't exist, which means `import metagame` raises AttributeError and any consumer crashes on startup. Restoring the future import fixes this without touching runtime behavior. Bumps to 0.5.1.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
4 tasks
Contributor
Author
|
Superseded by #385 — deleting the dead |
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
from __future__ import annotationsintrading_client.py, so class-body type hints are now evaluated at import time.get_market_positionsis annotated withwebsocket_api.MarketPositions, which doesn't exist as a symbol inwebsocket_api, soimport metagameraisesAttributeErrorand any consumer crash-loops on startup (already observed bringing down the scenarios server Fly deploy).Test plan
uv sync && uv run python -c "from metagame import TradingClient"succeeds locallyuv buildproducesmetagame-0.5.1-py3-none-any.whlandmetagame-0.5.1.tar.gzmetagame==0.5.1in dependent projects (scenarios) and confirm Fly smoke checks pass