Repository navigation
feat(rest): add version() to read the node's version and release - #32
Merged
Merged
Conversation
GeneralRestClient.version() calls GET /rpc/v3/version and returns the response as a dict. Nodes from supra_node_v12.0.0 include a `release` key; the key is absent from the response of an earlier node. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…release` Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # supra_sdk/clients/rest/general.py
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.
What
Adds
GeneralRestClient.version()(inherited bySupraClient), which readsGET /rpc/v3/versionand returns thenode's response as a dict.
Behaviour
version,release,branch,commit_hash,build_time,build_env.versionis the version of thenode's Rust packages and is the same for every release;
releaseidentifies the release (for examplesupra_node_v12.0.0,supra_node_v12.0.0.rc7for a candidate,unreleasedfor a build from a commit that is nota release).
supra_node_v12.0.0.rc7(every v11 release, and v12.0.0.rc1 to rc6) omitrelease; read it with.get("release"). Rules that differ between node lines can be chosen from it.Checks
make fmt-check,make lint,make typecheck: clean.make test-unit: 240 tests, OK (26 node-backed tests skipped).tests/unit/test_version.pychecks the request anda v12-shaped and a v11-shaped response over
httpx.MockTransport.make test-spec: 248 scenarios passed.make build: sdist and wheel built.supra_node_v12.0.0.rc7localnet (release: supra_node_v12.0.0.rc7) and asupra_node_v11.7.2localnet (no
releasekey).🤖 Generated with Claude Code