Skip to content

MNT: ci: MacOS: replace 'gobject-introspection' dependency with 'glib' - #29777

Closed
jayaddison wants to merge 30 commits into
matplotlib:mainfrom
jayaddison:issue-29732/unblock-macos-pygobject-updates
Closed

jayaddison wants to merge 30 commits into
matplotlib:mainfrom
jayaddison:issue-29732/unblock-macos-pygobject-updates

Conversation

@jayaddison

@jayaddison jayaddison commented Mar 18, 2025 •

Copy link
Copy Markdown
Contributor

PR summary

The girepository dependency previously provided by gobject-introspection has been migrated into glib.

  • Why is this change necessary?

To allow upgrades of pygobject (currently restricted to <3.52), we need to resolve the failure case originally reported in #29732.

  • What problem does it solve?

Unblocking upgrades of pygobject allows this project to stay current and receive updates and fixes in updated versions of that library.

  • What is the reasoning for this implementation?

Initially this is a draft PR where I'm only removing a legacy Homebrew gobject-introspection dependency.

Unlike the Linux-based counterpart, where I do find various reports of problems due to an updated girepository version requirement, I don't find similar reports mentioning MacOS -- so perhaps our dependency list is simply out-of-date and gobject-introspection causes a conflict?

PR checklist

May resolve #29732.

The `girepository` dependency previously provided by this dep has
been migrated[1] into `glib`, and `glib` is listed as a dep of the
`gtk4` package.

[1] - https://docs.gtk.org/girepository/migrating-gi.html
These packages are available via PyPI (e.g. using `pip install`),
but are also available -- and listed as dependencies of -- `gtk4`
in Homebrew, which we already install.
@jayaddison

Copy link
Copy Markdown
Contributor Author

(I probably should have temporarily disabled non-MacOS GitHub Actions workflow jobs during this pull request.. in any case, I am going to pause to wait for the latest set of CI results before pushing any more commits)

For the previous commit, I mistakenly believed that the `cairo`
Homebrew package also contained Python bindings; in fact, those are
found in a separate `py3cairo` package, added here.

Relates-to commit 447dd90.
@jayaddison

Copy link
Copy Markdown
Contributor Author

There is some relevant documentation that may help to figure out how to proceed:

* PyGObject_ and pycairo_ (>= 1.14.0): for the GTK-based backends. If using pip
(but not conda or system package manager) PyGObject must be built from
source; see `pygobject documentation
<https://pygobject.readthedocs.io/en/latest/devguide/dev_environ.html>`_.

@jayaddison jayaddison changed the title MNT: ci: remove MacOS 'gobject-introspection' dependency MNT: ci: MacOS: replace 'gobject-introspection' dependency with 'glib' Mar 25, 2025
@jayaddison

Copy link
Copy Markdown
Contributor Author

The latest status update here (52ee08e) is:

  • ✅ The build no longer fails during dependency installation on MacOS -- that is, pytest begins successfully... but...
  • ❌ ...the dependency-installation phase fails to install a functional GTK4+cairo environment.

The relevant error in the build logs is found at: https://github.com/matplotlib/matplotlib/actions/runs/14048541275/job/39334454171#step:10:307

gi.RepositoryError: Typelib file for namespace 'cairo', version '1.0' not found

...as already encountered during some of my previous testing last week.

I'm not sure I want to expend much more CI compute resource on this (especially after realizing that I could and should have disabled Azure Pipelines during this PR).

@jayaddison

Copy link
Copy Markdown
Contributor Author

I'm still confused by the apparent absence of the cairo typelib files during the Install Python dependencies step.

Could the fact that cairo is disabled during the glib Homebrew formula be relevant, I wonder?

https://github.com/Homebrew/homebrew-core/blob/cebf23119b463d17b11960effc132db606ff8831/Formula/g/glib.rb#L96

I'm taking a break from this for a while.

For the previous commit, I mistakenly believed that the `cairo`
Homebrew package also contained Python bindings; in fact, those are
found in a separate `py3cairo` package, added here.

Relates-to commit 447dd90.

(cherry picked from commit 1bfc185)

Conflicts:
	.github/workflows/tests.yml
These packages are available via PyPI (e.g. using `pip install`),
but are also available -- and listed as dependencies of -- `gtk4`
in Homebrew, which we already install.

(cherry picked from commit 447dd90)

Conflicts:
	.github/workflows/tests.yml
Comment thread .github/workflows/tests.yml Resolved
lmodern \
ninja-build \
pkg-config \
python3-cairo-dev \

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

NB: this isn't directly related to the MacOS build; but if we do install PyGObject from PyPI without retrieving any dependencies -- as I suggest in 6d41f1a -- then I think we'll need this system package installed during Linux-based CI workflows.

@jayaddison

jayaddison commented Mar 28, 2025 •

Copy link
Copy Markdown
Contributor Author

Tests passed on MacOS from commit 6d41f1a, but that is deceiving; neither GTK3 nor GTK4 loaded successfully, and as a result, testing of those backends was skipped.

edit: fixup for unintentional double-negative

@jayaddison

Copy link
Copy Markdown
Contributor Author

I think it'll make more sense to recommence this migration from a fresh branch; it doesn't seem worthwhile to rebase exploratory commits (because they are useful primarily in their original form) nor to attempt to merge significantly-conflicting upstream changes into this branch.

@jayaddison jayaddison closed this Apr 1, 2025
@jayaddison
jayaddison deleted the issue-29732/unblock-macos-pygobject-updates branch April 1, 2025 01:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Unit tests: MacOS 14 failures: gi-invoke-error-quark

1 participant