Skip to content

Commit 834a00f

Browse files
authored
Revised solution for PyGobject handling based on pinning. (#2190)
1 parent a7b9c3e commit 834a00f

File tree

4 files changed

+27
-31
lines changed

4 files changed

+27
-31
lines changed

changes/2187.bugfix.rst

-1
This file was deleted.

changes/2190.bugfix.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
New apps using Toga on Linux will impose an upper version pin on PyGObject, limiting that package to ``< 3.52.1``. This is required to ensure that older Debian-based distributions are supported by default. This pin can be removed if these support for these distributions is not required, as long as some additional changes are made to the ``system_requires`` and ``system_runtime_requires`` definitions. The required changes are included (commented out) as part of the new project template.

src/briefcase/bootstraps/toga.py

+13-15
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ def pyproject_table_linux(self):
6161
requires = [
6262
"toga-gtk~=0.4.7",
6363
# PyGObject 3.52.1 enforces a requirement on libgirepository-2.0-dev. This library
64-
# isn't available on Debian 12/Ubuntu 22.04. If you need to support those (or older)
65-
# releases, uncomment this version pin. See beeware/toga#3143.
66-
# "pygobject < 3.52.1",
64+
# isn't available on Debian 12/Ubuntu 22.04. If you don't need to support those (or
65+
# older) releases, you can remove this version pin. See beeware/toga#3143.
66+
"pygobject < 3.52.1",
6767
]
6868
"""
6969

@@ -72,23 +72,21 @@ def pyproject_table_linux_system_debian(self):
7272
system_requires = [
7373
# Needed to compile pycairo wheel
7474
"libcairo2-dev",
75-
# One of the following two packages are needed to compile PyGObject wheel.
76-
# Debian 12/Ubuntu 22.04 only has the older 1.0 version of the library.
77-
# If you use the older version, you'll also need to apply the pygobject pin
78-
# (see the linux requires table). See beeware/toga#3143.
79-
"libgirepository-2.0-dev",
80-
# "libgirepository1.0-dev",
75+
# One of the following two packages are needed to compile PyGObject wheel. If you
76+
# remove the pygobject pin in the requires list, you should also change to the
77+
# version 2.0 of the girepository library. See beeware/toga#3143.
78+
"libgirepository1.0-dev",
79+
# "libgirepository-2.0-dev",
8180
]
8281
8382
system_runtime_requires = [
8483
# Needed to provide GTK and its GI bindings
8584
"gir1.2-gtk-3.0",
86-
# One of the following two packages are needed to use PyGObject at runtime.
87-
# Debian 12/Ubuntu 22.04 only has the older 1.0 version of the library.
88-
# If you use the older version, you'll also need to apply the pygobject pin
89-
# (see the linux requires table). See beeware/toga#3143.
90-
"libgirepository-2.0-0",
91-
# "libgirepository-1.0-1",
85+
# One of the following two packages are needed to use PyGObject at runtime. If you
86+
# remove the pygobject pin in the requires list, you should also change to the
87+
# version 2.0 of the girepository library. See beeware/toga#3143.
88+
"libgirepository-1.0-1",
89+
# "libgirepository-2.0-0",
9290
# Dependencies that GTK looks for at runtime
9391
"libcanberra-gtk3-module",
9492
# Needed to provide WebKit2 at runtime

tests/commands/new/test_build_gui_context.py

+13-15
Original file line numberDiff line numberDiff line change
@@ -87,32 +87,30 @@ def main():
8787
requires = [
8888
"toga-gtk~=0.4.7",
8989
# PyGObject 3.52.1 enforces a requirement on libgirepository-2.0-dev. This library
90-
# isn't available on Debian 12/Ubuntu 22.04. If you need to support those (or older)
91-
# releases, uncomment this version pin. See beeware/toga#3143.
92-
# "pygobject < 3.52.1",
90+
# isn't available on Debian 12/Ubuntu 22.04. If you don't need to support those (or
91+
# older) releases, you can remove this version pin. See beeware/toga#3143.
92+
"pygobject < 3.52.1",
9393
]
9494
""",
9595
pyproject_table_linux_system_debian="""\
9696
system_requires = [
9797
# Needed to compile pycairo wheel
9898
"libcairo2-dev",
99-
# One of the following two packages are needed to compile PyGObject wheel.
100-
# Debian 12/Ubuntu 22.04 only has the older 1.0 version of the library.
101-
# If you use the older version, you'll also need to apply the pygobject pin
102-
# (see the linux requires table). See beeware/toga#3143.
103-
"libgirepository-2.0-dev",
104-
# "libgirepository1.0-dev",
99+
# One of the following two packages are needed to compile PyGObject wheel. If you
100+
# remove the pygobject pin in the requires list, you should also change to the
101+
# version 2.0 of the girepository library. See beeware/toga#3143.
102+
"libgirepository1.0-dev",
103+
# "libgirepository-2.0-dev",
105104
]
106105
107106
system_runtime_requires = [
108107
# Needed to provide GTK and its GI bindings
109108
"gir1.2-gtk-3.0",
110-
# One of the following two packages are needed to use PyGObject at runtime.
111-
# Debian 12/Ubuntu 22.04 only has the older 1.0 version of the library.
112-
# If you use the older version, you'll also need to apply the pygobject pin
113-
# (see the linux requires table). See beeware/toga#3143.
114-
"libgirepository-2.0-0",
115-
# "libgirepository-1.0-1",
109+
# One of the following two packages are needed to use PyGObject at runtime. If you
110+
# remove the pygobject pin in the requires list, you should also change to the
111+
# version 2.0 of the girepository library. See beeware/toga#3143.
112+
"libgirepository-1.0-1",
113+
# "libgirepository-2.0-0",
116114
# Dependencies that GTK looks for at runtime
117115
"libcanberra-gtk3-module",
118116
# Needed to provide WebKit2 at runtime

0 commit comments

Comments
 (0)