Skip to content
Open
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
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[flake8]
ignore=E501,E123,E124,E402,E731,E722,W504
exclude=subprojects,build
exclude=subprojects,build,.venv
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,5 @@
*.pyd
*.dll.a
.coverage
pdm.lock
.pdm-python
34 changes: 22 additions & 12 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,17 @@ pages:
dependencies:
- coverage
before_script:
- python -m pip install -r docs/requirements.txt
- python -m pip install "pdm!=2.17.3"
- python -m pdm install -v
script:
- python -m sphinx -T -E -W --keep-going -b html -d _build/doctrees -D language=en docs/ public
- python -m pdm run sphinx-build -T -E -W --keep-going -b html -d _build/doctrees -D language=en docs/ public
- mv coverage/ public/
artifacts:
paths:
- public
expire_in: 30 days
only:
- master
- main

sdist:
stage: build_and_test
Expand All @@ -75,12 +76,6 @@ mingw64:
MSYSTEM: "MINGW64"
<<: *mingw-defaults

python3.8:
variables:
PYTHON_VERSION: "3.8"
TEST_GTK_VERSION: "3.0"
<<: *defaults

python3.9:
variables:
PYTHON_VERSION: "3.9"
Expand Down Expand Up @@ -112,7 +107,6 @@ python3.12:
<<: *defaults

pypy3:
allow_failure: true
variables:
PYTHON_VERSION: "pypy3"
TEST_GTK_VERSION: "3.0"
Expand All @@ -126,9 +120,14 @@ old-i386-py3:
- coverage/
script:
- bash -x ./.gitlab-ci/test-docker-old.sh
# This build sometimes fails with message:
# ninja: error: loading 'build.ninja': Value too large for defined data type
retry:
max: 2
when: runner_system_failure
exit_codes: 1

gnome-master:
allow_failure: true
stage: build_and_test
image: quay.io/gnome_infrastructure/gnome-runtime-images:gnome-master
tags:
Expand All @@ -155,6 +154,17 @@ gnome-master-gtk4:
script:
- bash -x ./.gitlab-ci/test-flatpak.sh

python3.12-pdm:
stage: build_and_test
variables:
PYTHON_VERSION: "3.12"
TEST_GTK_VERSION: "3.0"
before_script:
- python -m pip install "pdm!=2.17.3"
- python -m pdm install -v
script:
- xvfb-run -a python -m pdm run pytest

minimal-meson:
allow_failure: true
stage: build_and_test
Expand All @@ -164,4 +174,4 @@ minimal-meson:
script:
- meson setup _build
- meson compile -C _build
- PYTEST_ADDOPTS="-k 'not test_cairo'" meson test -C _build --verbose
- PYTEST_ADDOPTS="-sv -k 'not test_cairo'" meson test -C _build --suite pygobject --verbose
19 changes: 6 additions & 13 deletions .gitlab-ci/build-sdists.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,16 @@ rm -Rf _sdist_build
meson setup _sdist_build
meson dist --no-tests --allow-dirty -C _sdist_build
mv _sdist_build/meson-dist/*.tar.xz dist/

VERSION=$(meson introspect --projectinfo --indent _sdist_build | awk -F'"' '/version/ { print $4 }')

rm -Rf _sdist_build

# Now the sdist for pypi
# Mark odd versions as PEP440 development versions (e.g. 0.1.0 -> 0.1.0.dev0)
cp pyproject.toml pyproject.toml.bak
awk '{
if (/^version = "/) {
split($0, a, "[ .\"]+");
if (a[4] % 2 != 0)
printf "version = \"%s.%s.%s.dev0\"\n", a[3], a[4], a[5];
else
print $0;
} else {
print $0;
}
}' pyproject.toml > _temp && mv _temp pyproject.toml
[[ "$VERSION" =~ ^[0-9]\.[0-9]*[13579]\. ]] && meson rewrite kwargs set project / version ${VERSION}.dev0

python -m pip install --upgrade build
python -m build --sdist
mv pyproject.toml.bak pyproject.toml

meson rewrite kwargs set project / version ${VERSION}
3 changes: 2 additions & 1 deletion .gitlab-ci/test-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,15 @@ source /tmp/venv/bin/activate
mkdir -p /tmp/venv/include/pypy3.9

python -m pip install --upgrade pip
python -m pip install flake8 meson meson-python pycairo
python -m pip install flake8 meson meson-python pycairo pytest pytest-cov

# CODE QUALITY
python -m flake8

# BUILD & TEST
python -m pip install --config-settings=setup-args="-Dtests=true" --no-build-isolation --editable '.[dev]'

# TEST
lcov --config-file .gitlab-ci/lcovrc --directory . --capture --initial --output-file \
"${COV_DIR}/${CI_JOB_NAME}-baseline.lcov"

Expand Down
10 changes: 5 additions & 5 deletions .gitlab-ci/test-flatpak.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ if [[ "$1" == "inflatpak" ]]; then
export COVERAGE_FILE="${COV_DIR}/.coverage.${COV_KEY}"
mkdir -p "${COV_DIR}"

python3 -m venv _venv
. _venv/bin/activate
pip install pycairo meson meson-python
pip install --config-settings=setup-args="-Dtests=true" --no-build-isolation --editable '.[dev]'
pytest -v --cov
python3 --version

pip install pycairo meson meson-python pytest pytest-cov
pip install --config-settings=setup-args="-Dtests=true" --no-build-isolation --editable .
python -m pytest -v --cov
python3 -m coverage lcov -o "${COV_DIR}/${COV_KEY}.py.lcov"
chmod -R 777 "${COV_DIR}"
else
Expand Down
13 changes: 0 additions & 13 deletions .readthedocs.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions PKG-INFO.in → METADATA.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Metadata-Version: 1.2
Name: PyGObject
Version: @VERSION@
Summary: Python bindings for GObject Introspection
Home-page: https://gnome.pages.gitlab.gnome.org/pygobject
Home-page: https://pygobject.gnome.org
Author: James Henstridge
Author-email: james@daa.com.au
Maintainer: Simon Feltman
Expand All @@ -18,4 +18,4 @@ Classifier: Operating System :: Microsoft :: Windows
Classifier: Programming Language :: C
Classifier: Programming Language :: Python
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8, <4
Requires-Python: >=3.9, <4
27 changes: 27 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,15 +1,42 @@
3.50.0 - 2024-09-12
-------------------

* tests: Fix event test errors when GTK is not installed :mr:`347`


3.49.0 - 2024-09-06 (pre-release)
---------------------------------

* Rename master branch to main
* Drop support for Python 3.8 :mr:`300`
* Add Override for Gio.DataInputStream :mr:`293`
* Treat GParamSpec as any other fundamental type :mr:`268`
* override connection.register_object to prevent an invocation object from
leaking :mr:`219`
* Various PyPy related fixes :mr:`299`
* bind_property: Accept keyword arguments :mr:`309`
* Various documentation improvements :mr:`342` :mr:`343` :mr:`338`
:mr:`336` :mr:`335` :mr:`328` :mr:`329` :mr:`330` :mr:`325` :mr:`322` :mr:`312`
* Python2 / GTK2 cleanups :mr:`338` :mr:`331`
* asyncio integration with support to await Gio async functions :mr:`189`
* meson: move from .egg-info to .dist-info/METADATA :mr:`306`
* build: fixes for building with gobject-introspection 1.81 :mr:`344`


3.48.2 - 2024-04-06
-------------------

* Fix support for fundamental (primitive) types, such as Gst.Bitmask
:issue:`624` :mr:`304`


3.48.1 - 2024-03-10
-------------------

* Fix installation with pip failing in some environments with
ModuleNotFoundError in g-ir-scanner :issue:`622` :mr:`302`


3.48.0 - 2024-03-09
-------------------

Expand Down
43 changes: 37 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,48 @@
|

**PyGObject** is a Python package which provides bindings for `GObject
<https://developer.gnome.org/gobject/stable/>`__ based libraries such as `GTK
<https://docs.gtk.org/gobject/>`__ based libraries such as `GTK
<https://www.gtk.org/>`__, `GStreamer <https://gstreamer.freedesktop.org/>`__,
`WebKitGTK <https://webkitgtk.org/>`__, `GLib
<https://developer.gnome.org/glib/stable/>`__, `GIO
<https://developer.gnome.org/gio/stable/>`__ and many more.
<https://docs.gtk.org/glib/>`__, `GIO
<https://docs.gtk.org/gio/>`__ and many more.

It supports Linux, Windows and macOS and works with **Python 3.8+** and
It supports Linux, Windows, and macOS and works with **Python 3.9+** and
**PyPy3**. PyGObject, including this documentation, is licensed under the
**LGPLv2.1+**.

Homepage
--------

----
https://pygobject.gnome.org

For more information visit https://gnome.pages.gitlab.gnome.org/pygobject
Installation
------------

The latest version from PyGObject can be installed from `PyPI <https://pypi.org/project/PyGObject/>`__:

pip install PyGObject

PyGObject is only distributed as source distribution, so you need a C compiler installed on your host.

Please have a look at our `Getting Started <https://pygobject.gnome.org/getting_started.html>`__ documentation
for OS specific installation instructions.

Development
~~~~~~~~~~~

Our website contains instructions on how to `set up a development environment
<https://pygobject.gnome.org/devguide/dev_environ.html>`__.

Default branch renamed to ``main``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The default development branch of PyGObject has been renamed
to ``main``. To update your local checkout, use::

git checkout master
git branch -m master main
git fetch
git branch --unset-upstream
git branch -u origin/main
git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/main
40 changes: 40 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,43 @@
pygobject (3.50.0-4) unstable; urgency=medium

[ Simon McVittie ]
* d/p/async-Use-correct-T_BOOL-type-for-_asyncio_future_blockin.patch:
Mark patch as applied upstream
* d/salsa-ci.yml: Use recommended recipe URL
* d/salsa-ci.yml: Disable Architecture: all build
* d/salsa-ci.yml: Don't attempt cross-building
* d/control: Explicitly build-depend on required GIR XML
* d/control: Build-depend on gobject-introspection and libgirepository-1.0-dev

-- Jeremy Bícha <jbicha@ubuntu.com> Fri, 17 Jan 2025 18:50:54 -0500

pygobject (3.50.0-3) unstable; urgency=medium

* Team upload
* Release to unstable (Closes: #1082723)

-- Simon McVittie <smcv@debian.org> Sat, 26 Oct 2024 13:44:07 +0100

pygobject (3.50.0-2) experimental; urgency=medium

* Team upload
* d/p/async-Use-correct-T_BOOL-type-for-_asyncio_future_blockin.patch:
Add proposed patch to fix asyncio calls on big-endian machines
(Closes: #1085891)
* Standards-Version: 4.7.0 (no changes required)
* d/source/lintian-overrides: Mark missing B-D on mesonpy as a false
positive.
We currently build with Meson directly, not via mesonpy.

-- Simon McVittie <smcv@debian.org> Wed, 23 Oct 2024 13:53:17 +0100

pygobject (3.50.0-1) experimental; urgency=medium

* New upstream release
* .egg-info has been replaced by .dist-info/METADATA

-- Jeremy Bícha <jbicha@ubuntu.com> Mon, 16 Sep 2024 15:37:16 -0400

pygobject (3.48.2-1) unstable; urgency=medium

* New upstream release
Expand Down
9 changes: 6 additions & 3 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@ Build-Depends: at-spi2-core <!nocheck>,
dbus-daemon <!nocheck>,
debhelper-compat (= 13),
dh-sequence-python3,
gir1.2-gtk-3.0 <!nocheck>,
gir1.2-cairo-1.0-dev,
gir1.2-gio-2.0-dev,
gir1.2-girepository-2.0 <!nocheck>,
gir1.2-gtk-3.0 <!nocheck>,
gobject-introspection,
libcairo2-dev,
libffi-dev (>= 3.3),
libgirepository1.0-dev (>= 1.64.0~),
libgirepository-1.0-dev,
libglib2.0-dev (>= 2.64.0),
locales <!nocheck>,
meson,
Expand All @@ -23,7 +26,7 @@ Build-Depends: at-spi2-core <!nocheck>,
xauth <!nocheck>,
xvfb <!nocheck>
Rules-Requires-Root: no
Standards-Version: 4.6.2
Standards-Version: 4.7.0
Vcs-Browser: https://salsa.debian.org/gnome-team/pygobject
Vcs-Git: https://salsa.debian.org/gnome-team/pygobject.git
Homepage: https://pygobject.readthedocs.io/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
From: Simon McVittie <smcv@debian.org>
Date: Wed, 23 Oct 2024 12:01:24 +0100
Subject: async: Use correct T_BOOL type for _asyncio_future_blocking

Declaring a PyMemberDef with type T_BOOL requires the corresponding C
type to be char, with value 0 or 1: when the member is read, CPython
will effectively be dereferencing
`* (char *) &pygiasync._asyncio_future_blocking`.

On little-endian architectures, in practice this worked, because the
low-order bits of an int are in the first byte, which would take value
0 or 1 as desired, with all other bits zero. However, on big-endian
architectures, the low-order bits of an int are in the last byte, so
reading the _asyncio_future_blocking attribute from Python code would
in practice always produce 0, even when the int field had been set to 1
from C code.

Reference: https://docs.python.org/3/c-api/structures.html#member-types
Bug: https://gitlab.gnome.org/GNOME/pygobject/-/issues/650
Bug-Debian: https://bugs.debian.org/1085891
Signed-off-by: Simon McVittie <smcv@debian.org>
Forwarded: https://gitlab.gnome.org/GNOME/pygobject/-/merge_requests/367
Applied-upstream: 3.51.0, commit:a2445df58a712980ccd0c21d75a631c6bda89b2b
---
gi/pygi-async.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gi/pygi-async.h b/gi/pygi-async.h
index d5e7a92..341d623 100644
--- a/gi/pygi-async.h
+++ b/gi/pygi-async.h
@@ -37,7 +37,7 @@ typedef struct {
PyGICallableInfo *finish_func;
PyObject *loop;
PyObject *cancellable;
- int _asyncio_future_blocking;
+ char _asyncio_future_blocking;
PyObject *result;
PyObject *exception;

1 change: 1 addition & 0 deletions debian/patches/series
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
async-Use-correct-T_BOOL-type-for-_asyncio_future_blockin.patch
Loading
Loading