From 4182cb91044936f7591299052a0d1534e00daa4d Mon Sep 17 00:00:00 2001 From: crthpl Date: Mon, 13 Apr 2026 15:05:57 -0700 Subject: [PATCH] Remove dead get_market_positions method and fix 0.5.0 ImportError MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `get_market_positions` referenced `websocket_api.MarketPositions` and `websocket_api.GetMarketPositions`, neither of which exist in the proto schema, the Rust backend, or the generated websocket_api module. The method could never have worked — it was only invisible because 0.4.x had `from __future__ import annotations` making the dangling return type lazy. 0.5.0 dropped the future import, surfacing the bug at `import metagame` time and crash-looping every consumer. 0.5.1 plastered over it by restoring `from __future__ import annotations`, but that approach hides similar dead code from ever being caught. Instead, delete the method (positions are already streamed via Portfolio on the normal ServerMessage channel) and keep annotations eagerly evaluated. Bumps to 0.5.2. --- python-client/pyproject.toml | 2 +- python-client/src/metagame/trading_client.py | 14 -------------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/python-client/pyproject.toml b/python-client/pyproject.toml index 48829082..fff17078 100644 --- a/python-client/pyproject.toml +++ b/python-client/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "metagame" -version = "0.5.0" +version = "0.5.2" description = "MetaGame Trading Bootcamp Python Client" readme = "README.md" authors = [ diff --git a/python-client/src/metagame/trading_client.py b/python-client/src/metagame/trading_client.py index 10c528ef..a947a14a 100644 --- a/python-client/src/metagame/trading_client.py +++ b/python-client/src/metagame/trading_client.py @@ -534,20 +534,6 @@ def edit_auction( assert isinstance(message, websocket_api.Auction) return message - def get_market_positions(self, market_id: int) -> websocket_api.MarketPositions: - """ - Get positions for all participants in a market. - """ - msg = websocket_api.ClientMessage( - get_market_positions=websocket_api.GetMarketPositions( - market_id=market_id, - ), - ) - response = self.request(msg) - _, message = betterproto.which_one_of(response, "message") - assert isinstance(message, websocket_api.MarketPositions) - return message - def set_market_status( self, market_id: int,