Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revised solution for PyGobject handling based on pinning. #2190

Merged
merged 2 commits into from
Mar 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion changes/2187.bugfix.rst

This file was deleted.

1 change: 1 addition & 0 deletions changes/2190.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +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.
28 changes: 13 additions & 15 deletions src/briefcase/bootstraps/toga.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ def pyproject_table_linux(self):
requires = [
"toga-gtk~=0.4.7",
# PyGObject 3.52.1 enforces a requirement on libgirepository-2.0-dev. This library
# isn't available on Debian 12/Ubuntu 22.04. If you need to support those (or older)
# releases, uncomment this version pin. See beeware/toga#3143.
# "pygobject < 3.52.1",
# isn't available on Debian 12/Ubuntu 22.04. If you don't need to support those (or
# older) releases, you can remove this version pin. See beeware/toga#3143.
"pygobject < 3.52.1",
]
"""

Expand All @@ -72,23 +72,21 @@ def pyproject_table_linux_system_debian(self):
system_requires = [
# Needed to compile pycairo wheel
"libcairo2-dev",
# One of the following two packages are needed to compile PyGObject wheel.
# Debian 12/Ubuntu 22.04 only has the older 1.0 version of the library.
# If you use the older version, you'll also need to apply the pygobject pin
# (see the linux requires table). See beeware/toga#3143.
"libgirepository-2.0-dev",
# "libgirepository1.0-dev",
# One of the following two packages are needed to compile PyGObject wheel. If you
# remove the pygobject pin in the requires list, you should also change to the
# version 2.0 of the girepository library. See beeware/toga#3143.
"libgirepository1.0-dev",
# "libgirepository-2.0-dev",
]

system_runtime_requires = [
# Needed to provide GTK and its GI bindings
"gir1.2-gtk-3.0",
# One of the following two packages are needed to use PyGObject at runtime.
# Debian 12/Ubuntu 22.04 only has the older 1.0 version of the library.
# If you use the older version, you'll also need to apply the pygobject pin
# (see the linux requires table). See beeware/toga#3143.
"libgirepository-2.0-0",
# "libgirepository-1.0-1",
# One of the following two packages are needed to use PyGObject at runtime. If you
# remove the pygobject pin in the requires list, you should also change to the
# version 2.0 of the girepository library. See beeware/toga#3143.
"libgirepository-1.0-1",
# "libgirepository-2.0-0",
# Dependencies that GTK looks for at runtime
"libcanberra-gtk3-module",
# Needed to provide WebKit2 at runtime
Expand Down
28 changes: 13 additions & 15 deletions tests/commands/new/test_build_gui_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,32 +87,30 @@ def main():
requires = [
"toga-gtk~=0.4.7",
# PyGObject 3.52.1 enforces a requirement on libgirepository-2.0-dev. This library
# isn't available on Debian 12/Ubuntu 22.04. If you need to support those (or older)
# releases, uncomment this version pin. See beeware/toga#3143.
# "pygobject < 3.52.1",
# isn't available on Debian 12/Ubuntu 22.04. If you don't need to support those (or
# older) releases, you can remove this version pin. See beeware/toga#3143.
"pygobject < 3.52.1",
]
""",
pyproject_table_linux_system_debian="""\
system_requires = [
# Needed to compile pycairo wheel
"libcairo2-dev",
# One of the following two packages are needed to compile PyGObject wheel.
# Debian 12/Ubuntu 22.04 only has the older 1.0 version of the library.
# If you use the older version, you'll also need to apply the pygobject pin
# (see the linux requires table). See beeware/toga#3143.
"libgirepository-2.0-dev",
# "libgirepository1.0-dev",
# One of the following two packages are needed to compile PyGObject wheel. If you
# remove the pygobject pin in the requires list, you should also change to the
# version 2.0 of the girepository library. See beeware/toga#3143.
"libgirepository1.0-dev",
# "libgirepository-2.0-dev",
]

system_runtime_requires = [
# Needed to provide GTK and its GI bindings
"gir1.2-gtk-3.0",
# One of the following two packages are needed to use PyGObject at runtime.
# Debian 12/Ubuntu 22.04 only has the older 1.0 version of the library.
# If you use the older version, you'll also need to apply the pygobject pin
# (see the linux requires table). See beeware/toga#3143.
"libgirepository-2.0-0",
# "libgirepository-1.0-1",
# One of the following two packages are needed to use PyGObject at runtime. If you
# remove the pygobject pin in the requires list, you should also change to the
# version 2.0 of the girepository library. See beeware/toga#3143.
"libgirepository-1.0-1",
# "libgirepository-2.0-0",
# Dependencies that GTK looks for at runtime
"libcanberra-gtk3-module",
# Needed to provide WebKit2 at runtime
Expand Down