Repository navigation
fix: allow modern PyGObject so conda-forge installs work (#1) - #18
Merged
Merged
Conversation
The PyGObject<3.52 pin made `pip install ".[pangocairo]"` downgrade the working conda-forge PyGObject (3.58) and try to build 3.50 from source, which fails without girepository-1.0 headers. conda-forge's last 3.50 build also ships without gi._gi_cairo, the cause of the original "could not find foreign type Context" error. Drop the pin and move CI and the Dockerfile to libgirepository-2.0-dev (available on Ubuntu 24.04 and Debian 13). gcc is now listed explicitly, since libgirepository1.0-dev used to pull it in. The README documents the conda-forge route and the pin for older systems. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Fy1wuWdqcKuebgj3St8dME
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 #1.
What was broken
I followed the README in a fresh conda env (Python 3.12, conda-forge
pycairo pygobject pango), then ranpip install ".[dev,pangocairo]". It fails:pyproject.tomlpinsPyGObject<3.52, so pip tries to replace conda-forge's working PyGObject 3.58 with 3.50 and build it from source. The build fails because 3.50 needs girepository-1.0 headers.pygobject<3.52gets you 3.50.0, whose build ships withoutgi/_gi_cairo. That module is behind the originalKeyError: 'could not find foreign type Context'in Add instructions for alternative installation #1.Changes
pyproject.toml: drop thePyGObject<3.52pin.Dockerfile:libgirepository1.0-dev→libgirepository-2.0-dev(Ubuntu 24.04 / Debian 13 have GLib ≥ 2.80). Addgccexplicitly: pycairo and PyGObject have no Linux wheels, and the oldlibgirepository1.0-devpulledgccin as a dependency.README.md: document the conda-forge route, the apt packages for pip-only installs, and thePyGObject<3.52fallback for older systems such as Ubuntu 22.04.Verified
pip install ".[dev,pangocairo]"(README)uv pip install ".[dev,pangocairo]"(CI setup)docker build .(python:3.14-slim)(16, 48, 3) ✅Trade-off: a pip-only install on GLib < 2.80 (Ubuntu 22.04) now needs
pip install "PyGObject<3.52"first, as documented in the README.🤖 Generated with Claude Code
https://claude.ai/code/session_01Fy1wuWdqcKuebgj3St8dME
Note
Low Risk
Changes affect optional pangocairo install docs and CI/Docker system packages only; runtime renderer code is unchanged, with a documented manual pin for legacy GLib systems.
Overview
Unpins PyGObject so
pip install ".[pangocairo]"no longer downgrades conda-forge’s PyGObject 3.58 to 3.50 (which broke installs andgi/_gi_cairo).Build/CI apt deps move from
libgirepository-1.0/libgirepository1.0-devtolibgirepository-2.0-devfor GLib ≥ 2.80 (Ubuntu 24.04+), drop the runtimelibgirepository-1.0-1package from the CI list, and addgccexplicitly in the Dockerfile because source builds ofpycairo/PyGObjectno longer pull it in transitively.README documents the conda-forge install path, apt packages for pip-only builds on modern Debian/Ubuntu, and the
PyGObject<3.52+libgirepository1.0-devfallback for older GLib (e.g. Ubuntu 22.04).Reviewed by Cursor Bugbot for commit d009aef. Bugbot is set up for automated code reviews on this repo. Configure here.