Skip to content

Protobuf dependency conflict: votify crashes at import with the librespot extra (upstream #103 / #105) #11

Description

@JavaGT

Protobuf dependency conflict: votify crashes at import with the librespot extra (upstream glomatico#103 / glomatico#105)

Evidence (all verified locally, 2026-09-13)

Three layers combine:

  1. Undeclared direct dependency. votify's generated protobuf code (votify/api/proto/*_pb2.py, header "Protobuf Python Version: 6.33.4") imports google.protobuf.runtime_version (protobuf >= 5.27), but pyproject.toml never declares protobuf — it arrives only transitively via pywidevine>=1.9.0. requirements.txt already declares protobuf>=6.33.5 while pyproject does not (split-brain). Environments where protobuf resolves older crash at startup with ImportError: cannot import name 'runtime_version' (the traceback in upstream ImportError: cannot import name 'runtime_version' from 'google.protobuf' glomatico/votify#103).
  2. Unbounded librespot extra. pyproject.toml:32-33 allows librespot>=0.0.1. PyPI metadata (fetched 2026-09-13): librespot 0.0.2 pins protobuf==4.21.0 and 0.0.3–0.0.10 pin protobuf==3.20.1 — all irreconcilable with pywidevine's >=6.33.0,<7 (upstream Dependency conflict: protobuf incompatibility between librespot and pywidevine makes Votify unusable glomatico/votify#105).
  3. Even the resolvable combo breaks at runtime. librespot 0.0.1 + protobuf 6.33.x (what the maintainer's own uv.lock ships) crashes when the librespot session is used: librespot 0.0.1's gencode predates protoc 3.19 and dies with TypeError: Descriptors cannot be created directly under the default upb backend (verified on Python 3.14). Amplifier: SpotifyApi.__init__ defaults to session_type=SessionType.LIBRESPOT (votify/api/api.py:47), so the extra is on the default README path.

Proposed fix (staged as a fork PR, linked below)

  • Declare protobuf>=6.33.5 directly in [project].dependencies (no <7 cap — protobuf's official cross-version runtime guarantee supports gencode since 3.20.0 through runtime 8.x).
  • Cap the extra: librespot>=0.0.1,<0.0.2 (the only release whose metadata can resolve with protobuf 6.x).
  • In votify/__init__.py, os.environ.setdefault("PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION", "python") guarded by find_spec("librespot"), so the default librespot session works out of the box; users without the extra keep the faster upb backend.
  • Regenerate uv.lock.

Attribution

This issue was produced with AI assistance under the direction of @JavaGT: exploration, evidence verification and implementation by GLM agents (ZCode); plan and diff audited by OpenAI GPT-5.6 ("Luna") and xAI Grok 4.6 via opencode.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions