Skip to content

Update client to support codified synapseAPI versioning scheme#178

Merged
namthor9 merged 5 commits into
mainfrom
versioning
May 22, 2026
Merged

Update client to support codified synapseAPI versioning scheme#178
namthor9 merged 5 commits into
mainfrom
versioning

Conversation

@namthor9
Copy link
Copy Markdown
Contributor

Bump synapse-api version, reads and reports client API version, adds uint32->string parsing for device API version

namthor9 added 4 commits May 22, 2026 11:58
setup.py reads the canonical API version from the synapse-api
submodule's VERSION file and stamps it into synapse/_api_version.py.
The constant is re-exported from synapse so clients can do:

    from synapse import SYNAPSE_API_VERSION

to compare against a server's reported version.

_api_version.py is committed (with the current 2.4.0 value) so that
sdist installs without the submodule still work; setup.py only updates
it when the submodule is present.

NOTE: requires bumping the synapse-api submodule pointer to a commit
that contains VERSION before the stamping path becomes active. The
current pointer (6c0905e) predates that file.
Previously printed only the science-synapse package version. Now also
prints the API version the client targets, so users debugging a
mismatch can see both at a glance:

    $ synapsectl --version
    synapsectl 2.5.0 (Synapse API 2.4.0)
Picks up the new VERSION file so setup.py's stamp_api_version() now
has a source to read from. Without this bump the stamping was a no-op
and synapse/_api_version.py would have drifted as a hand-edited file.
DeviceInfo.synapse_version is encoded by the server as a uint32 with
the layout [major:8][minor:8][patch:16]. Add a decoder in
synapse.utils.version and use it in the CLI's info display so users
see "Synapse Version: 2.4.0" instead of "Synapse Version: 33816576".
@calvinleng-science
Copy link
Copy Markdown
Contributor

reminder to repin synapse-api to new head of main

Copy link
Copy Markdown
Contributor

@calvinleng-science calvinleng-science left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@namthor9 namthor9 merged commit 0f5c4de into main May 22, 2026
2 checks passed
@namthor9 namthor9 deleted the versioning branch May 22, 2026 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants