Conversation
- Declare protobuf>=6.33.5 directly in pyproject: votify's generated protobuf code requires a 6.33+ runtime but it was previously only pulled in transitively via pywidevine, so environments where an incompatible protobuf (e.g. 3.20.1 from newer librespot releases) got installed crashed with ImportError: cannot import name runtime_version - Cap the librespot extra at 0.0.1: every later librespot release pins protobuf==3.20.1 (0.0.3+) or ==4.21.0 (0.0.2), which cannot resolve alongside pywidevine's protobuf>=6.33.0,<7.0.0 requirement - Select the pure-Python protobuf implementation when librespot is installed: librespot 0.0.1 ships gencode predating protoc 3.19 that only loads under that backend, and votify's default session_type is librespot; this makes a fresh votify[librespot] install work as-is References glomatico#105, glomatico#103
This branch has not been deployed
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.
Fixes #105, fixes #103.
What
A fresh
pip install 'votify[librespot]'now works out of the box: protobuf is declared as a direct dependency, thelibrespotextra is capped to the only release that can resolve alongside it, and the pure-Python protobuf backend is selected automatically when librespot is installed.Why
Three overlapping problems cause the failures reported in #105 and #103:
votify/api/proto/*_pb2.py, generated by protoc 6.33.4) requires a protobuf runtime >= 6.33, butpyproject.tomlnever declared protobuf — it only arrived transitively via pywidevine (protobuf>=6.33.0,<7). Environments where an older protobuf gets installed crash at startup withImportError: cannot import name 'runtime_version'(ImportError: cannot import name 'runtime_version' from 'google.protobuf' #103).librespotextra was unbounded (librespot>=0.0.1), but every later librespot release pins an incompatible protobuf (==4.21.0for 0.0.2,==3.20.1for 0.0.3–0.0.10), which cannot resolve alongside pywidevine. That is the resolution conflict in Dependency conflict: protobuf incompatibility between librespot and pywidevine makes Votify unusable #105.uv.lockalready ships) breaks at runtime: librespot 0.0.1's gencode predates protoc 3.19 and only loads under the pure-Python protobuf implementation — hence thePROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=pythonworkaround in the Dependency conflict: protobuf incompatibility between librespot and pywidevine makes Votify unusable #105 comments. Sincesession_typedefaults tolibrespot(votify/api/api.py), this hit the default path.The changes
pyproject.toml: declareprotobuf>=6.33.5in[project].dependencies(floor matchesrequirements.txt; no<7cap — protobuf's official cross-version guarantee supports gencode since 3.20.0 through runtime 8.x).pyproject.toml: cap the extra atlibrespot>=0.0.1,<0.0.2— the only release whose metadata is compatible, making resolution deterministic instead of dependent on pip backtracking. Worth lifting when librespot-python regenerates its protos and drops theprotobuf==3.20.1pin.votify/__init__.py:os.environ.setdefault("PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION", "python"), guarded byfind_spec("librespot"), so it runs before any protobuf import on the CLI path. Users without the extra keep the faster default (upb) backend; an explicitly set environment variable is respected.uv.lock: regenerated withuv lock.Verification
All in fresh venvs (Python 3.14.6 and the 3.10 floor from
.python-version), re-confirmed today on 3.10:pip install votifyandpip install 'votify[librespot]'both resolve;pip checkclean; resolves librespot 0.0.1 + protobuf 6.33.6 (matches the combouv.lockalready shipped).votify --helpruns in both installs.pip install 'votify[librespot]' 'librespot==0.0.10'fails resolution as intended;uv lock --checkpasses..wvddevice file).Attribution
This PR was produced with AI assistance under the direction of @JavaGT:
consulted via opencode
Every change was cross-reviewed by the consultant models and the final diff
verified against the described behavior. Happy to adjust or close any part
of this — tell me what doesn't fit the project's direction.