Skip to content

Commit

Permalink
Fix CI on macOS 13. (jendrikseipp#756)
Browse files Browse the repository at this point in the history
  • Loading branch information
jendrikseipp committed May 5, 2024
1 parent 1bfbe6d commit 2df33da
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Python
uses: actions/setup-python@v4.4.0
uses: actions/setup-python@v5
with:
python-version: ${{ env.python_version }}
- name: Install macOS Dependencies
Expand Down
20 changes: 14 additions & 6 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,26 +36,34 @@ jobs:
run: |
sudo apt-get update
sudo apt-get -y install -qq gettext gir1.2-gdkpixbuf-2.0 gir1.2-glib-2.0 gir1.2-gtk-3.0 gir1.2-gtksource-4 gir1.2-pango-1.0 gir1.2-webkit2-4.0 python3 python3-enchant python3-gi python3-yaml
python3 -m pip install setuptools tox
- name: Install dependencies (macOS)
if: startsWith(matrix.os, 'macos')
run: |
# We need pygobject from PyPI. Using only pygobject3 from homebrew leads to "gi module not found".
brew install gettext gtk+3 gobject-introspection glib libffi cairo gtksourceview3 atk librsvg gsettings-desktop-schemas adwaita-icon-theme enchant
python3 -m pip install pyenchant pygobject pyyaml
# Homebrew complains about python@3.12 files that are overwritten, so we remove them.
# Some can be removed by unlinking python@3.12, others need to be removed manually.
brew unlink python@3.12
brew link --overwrite python@3.12
sudo rm -r /usr/local/bin/2to3 /usr/local/bin/idle3 /usr/local/bin/pydoc3 /usr/local/bin/python3 /usr/local/bin/python3-config /usr/local/share/man/man1/python3.1 /usr/local/lib/pkgconfig/python3-embed.pc /usr/local/lib/pkgconfig/python3.pc /usr/local/Frameworks/Python.framework/Headers /usr/local/Frameworks/Python.framework/Python /usr/local/Frameworks/Python.framework/Resources /usr/local/Frameworks/Python.framework/Versions/Current
brew install gettext gobject-introspection gtk+3 libffi cairo gtksourceview3 librsvg adwaita-icon-theme enchant
# Removing the Python files above makes pip complain about "managed environments", so we need to "break system packages".
python3 -m pip install --break-system-packages pyenchant pygobject pyyaml
python3 -m pip install --break-system-packages setuptools tox
env:
# https://docs.brew.sh/Manpage#install-options-formulacask-
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: on

- name: Install common dependencies
run: |
python3 -m pip install setuptools tox
HOMEBREW_NO_INSTALL_CLEANUP: on
HOMEBREW_NO_INSTALL_UPGRADE: on

- name: Check style
if: matrix.os == 'ubuntu-22.04'
run: |
python3 -m tox -v -e style
- name: Run tests
if: matrix.os == 'ubuntu-22.04' # pip on macOS needs --break-system-packages
run: |
python3 -c "import gi"
python3 -m tox -v -e py
Expand Down

0 comments on commit 2df33da

Please sign in to comment.