Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9f939fa

Browse files
committed
Try installing GTK from wingtk project
1 parent 1c351b6 commit 9f939fa

File tree

1 file changed

+28
-14
lines changed

1 file changed

+28
-14
lines changed

azure-pipelines.yml

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -78,20 +78,38 @@ stages:
7878
python -m pip install -r requirements/testing/all.txt -r requirements/testing/extra.txt
7979
displayName: 'Install dependencies with pip'
8080
81-
- bash: |
81+
- pwsh: |
82+
Invoke-WebRequest `
83+
https://github.com/wingtk/gvsbuild/releases/download/2025.5.0/GTK4_Gvsbuild_2025.5.0_x64.zip `
84+
-OutFile $(Agent.BuildDirectory)\GTK4.zip
85+
Write-Host "##vso[task.prependpath]$(Agent.BuildDirectory)\gtk4\bin"
86+
displayName: 'Download system dependencies'
87+
88+
- task: ExtractFiles@1
89+
inputs:
90+
archiveFilePatterns: '$(Agent.BuildDirectory)\GTK4.zip'
91+
destinationFolder: '$(Agent.BuildDirectory)\gtk4'
92+
93+
- pwsh: |
8294
# GUI toolkits are pip-installable only for some versions of Python so don't fail if we can't install
8395
# them. Make it easier to check whether the install was successful by trying to import the toolkit
8496
# (sometimes, the install appears to be successful but shared libraries cannot be loaded at runtime, so
8597
# an actual import is a better check).
86-
python -m pip install --upgrade pycairo cairocffi>=0.8
87-
python -m pip install --upgrade PyGObject &&
88-
(
89-
python -c 'import gi; gi.require_version("Gtk", "4.0"); from gi.repository import Gtk' &&
90-
echo 'PyGObject 4 is available' || echo 'PyGObject 4 is not available'
91-
) && (
92-
python -c 'import gi; gi.require_version("Gtk", "3.0"); from gi.repository import Gtk' &&
93-
echo 'PyGObject 3 is available' || echo 'PyGObject 3 is not available'
94-
)
98+
python -m pip install (Resolve-Path $(Agent.BuildDirectory)\gtk4\wheels\pycairo*.whl) cairocffi>=0.8
99+
if ('$(python.version)' -eq '3.13') {
100+
python -m pip install (Resolve-Path $(Agent.BuildDirectory)\gtk4\wheels\PyGObject*.whl) &&
101+
(
102+
python -c 'import gi; gi.require_version("Gtk", "4.0"); from gi.repository import Gtk' &&
103+
echo 'PyGObject 4 is available' || echo 'PyGObject 4 is not available'
104+
) && (
105+
python -c 'import gi; gi.require_version("Gtk", "3.0"); from gi.repository import Gtk' &&
106+
echo 'PyGObject 3 is available' || echo 'PyGObject 3 is not available'
107+
)
108+
python -m pip install --upgrade --only-binary :all: wxPython &&
109+
python -c 'import wx' &&
110+
echo 'wxPython is available' ||
111+
echo 'wxPython is not available'
112+
}
95113
python -m pip install --upgrade pyqt5 &&
96114
python -c 'import PyQt5.QtCore' &&
97115
echo 'PyQt5 is available' ||
@@ -100,10 +118,6 @@ stages:
100118
python -c 'import PySide2.QtCore' &&
101119
echo 'PySide2 is available' ||
102120
echo 'PySide2 is not available'
103-
python -m pip install --upgrade --only-binary :all: wxPython &&
104-
python -c 'import wx' &&
105-
echo 'wxPython is available' ||
106-
echo 'wxPython is not available'
107121
displayName: 'Install GUI dependencies with pip'
108122
109123
- bash: |

0 commit comments

Comments
 (0)