| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
Subscribing a subclass of `Generic[...]` (e.g. `Gio.ListStore[Gio.File]`)
will turn it into instance of `typing._GenericAlias`.
That is not an instance of `type`, nor a subclass of the subscribed class.
To allow passing instantiated generic types as `type` argument of `Property`,
we need to extract the generic type, or property will fail with `Unsupported type` error.
Unfortunately, `typing` module only provides helper for that since Python 3.8
so we need to create our own `get_origin` that looks into internal state for 3.7.
|
|
|
|
|
|
|
|
|
|
|
| |
Since we are already defining a type variable for the Generic parent class,
we might as well put it to good use and add type annotations to the methods.
These do not really appear to do anything other than serve as a documentation for now.
Had to disable E704 flake8 rule since it misplaces ellipsis.
In fact, this is why it is ignored in the default configuration:
https://github.com/PyCQA/pycodestyle/issues/973
|
|
|
|
|
|
| |
Otherwise trying to use `Gio.ListStore[Foo]` in a type annotation in an app will crash:
TypeError: 'GObjectMeta' object is not subscriptable
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Half a year ago they broke due to some changes of either the
gnome-runtime-images docker images, or the contained flatpak, or
something else: https://gitlab.gnome.org/GNOME/gnome-runtime-images/-/issues/7
This creates a fake dbus system bus so flatpak run doesn't fail.
After this it turned out that pip install is now completely broken
in the sdk and it installs packages to a place where it can't find them
afterwards, so just use a venv instead.
Finally the pygobject test suite still crashes at some point,
but at least it's better then before.
|
|
|
|
|
|
|
|
|
| |
0.53.0 targets Ubuntu 20.04, also matches what pycairo needs currently.
Update the libffi wrap to match what glib uses (the old one no longer
works with current glib)
And target pycairo main (we target main for everything else too..)
|
|
|
|
|
|
|
|
|
|
|
| |
Py_TRASHCAN_SAFE_BEGIN and Py_TRASHCAN_SAFE_END are deprecated since Python 3.11
and result in a deprecation warning when building against Python 3.11.
This follows the suggested migration to Py_TRASHCAN_BEGIN and Py_TRASHCAN_END
in https://docs.python.org/3/whatsnew/3.11.html
Py_TRASHCAN_BEGIN only exists since Python 3.8, while we still support 3.7,
so also use the suggested macro to support older Python versions.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
If two threads are trying to load a type at exactly the same time,
it's possible for two wrappers to get generated for the type.
One thread will end up with the wrapper that's not blessed as the
"real" one and future calls will fail. The blessed wrapper will
be incomplete, and so future calls from it will fail as well.
This commit adds a lock to ensure the two threads don't stomp
on each others toes.
|
|
|
|
|
|
|
| |
This reverts commit fc776c2058e11da5c3a4cebeea7f313057bc079f.
This might have caused a regression, see #535.
Until we know more revert this for now.
|
|
|
|
|
|
| |
The gnome-runtime-images have been recently migrated to Quay. This is already reflected in the template.
Please note this MR has been created semi-automatically. If it doesn't make sense, feel free to close it.
|
|
|
|
|
| |
+ python -m flake8
./examples/demo/demos/combobox.py:212:24: E275 missing whitespace after keyword
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These functions were deprecated in gobject-introspection 1.72
GI_CHECK_VERSION was added after gobject-introspection 1.58, and we
require 1.56.
../gi/pygi-closure.c: In function ‘_pygi_invoke_closure_free’:
../gi/pygi-closure.c:635:5: warning: ‘g_callable_info_free_closure’ is deprecated: Use 'g_callable_info_destroy_closure' instead [-Wdeprecated-declarations]
635 | g_callable_info_free_closure (invoke_closure->info,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../gi/pygi-closure.h:22,
from ../gi/pygi-closure.c:20:
/usr/include/gobject-introspection-1.0/girffi.h:106:15: note: declared here
106 | void g_callable_info_free_closure (GICallableInfo *callable_info,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
../gi/pygi-closure.c: In function ‘_pygi_make_native_closure’:
../gi/pygi-closure.c:674:9: warning: ‘g_callable_info_prepare_closure’ is deprecated: Use 'g_callable_info_create_closure' instead [-Wdeprecated-declarations]
674 | g_callable_info_prepare_closure (info, &closure->cif, _pygi_closure_handle,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/gobject-introspection-1.0/girffi.h:100:15: note: declared here
100 | ffi_closure * g_callable_info_prepare_closure (GICallableInfo *callable_info,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
| |
|
|
|
| |
I haven't done anything to pygobject in the last 8 years, and forgot everything. I have no authority over this right now.
|
| |
|
|
|
|
|
|
|
|
| |
When the interface is being registered by PyGObject and again through
an override, the first one is being leaks, free it at this point.
We need to copy the GInterfaceInfo to set on the GType QData as we
do not own it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Up until now pycairo provided a cairo.get_include() helper which
could be used to find the required include directory matching the module,
considering various scenarios.
Starting with 3.8 this leads to problems on Windows since CPython on Windows
will no longer use PATH for the DLL lookup and expects the library user to
explicitely pass the directory where the cairo DLL can be found.
In a build environment the user has no control over this though, so we have to
find the include directory without loading/importing pycairo again.
This now uses a combination of importlib.util.find_spec() for finding the module
and importlib.metadata.distribution() for finding the package version.
Hopefully this covers all cases.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Python 3.8 no longer uses PATH for searching DLLs so we have to
add them manually.
Note that unlike PATH add_dll_directory() has no defined order,
so if there are two same DLLs in PATH we might get a random one.
This only makes sure that 'setup.py test' and 'pytest' continue working.
If you include pygobject manually you have to call os.add_dll_directory()
yourself with the location of the DLLs you ship.
|
|
|
|
|
| |
The test_gvalue_gobject_ref_counts appears to be working just fine these
days.
|
|
|
|
|
|
|
| |
PyList_GET_ITEM only returns a borrowed reference. In the unlikely event
of an error converting the key or value, the reference would be
unintentionally decremented. This could cause random failures later on
(and was indeed causing the PyPy test to fail randomly later on).
|
| |
|
|
|
|
| |
Check for required type, instead of negating invalid type.
|
| |
|
| |
|
| |
|
|
|
|
| |
Why does a g_instance_init() function only handle GObjects?
|
|
|
|
| |
uses the aforementioned build system.
|
|
|
|
| |
So it uses a newer sphinx
|
|
|
|
|
|
|
| |
newer pycoverage supports lcov as output format, so convert
to lcov and only generate one report at the end for everything.
The lcov report isn't that nice, but at least everything is in one place.
|
| |
|
|
|
|
| |
It's not used in GTK 4.
|
|
|
|
| |
Those methods require a Gdk.ContentFormats object.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
An attempt to pass a Path object as a filename results in a TypeError:
"Must be bytes, not PosixPath". A simple way to accept Path objects
would be unconditionally turning them into strings, but since native
paths may be bytes as well, this might break applications relying on
being able to bytes-based filename. Instead, convert the path into an
appropriate representation (string or bytes) using os.fspath(). It
internally tests whether the path is a PathLike object and does the
right thing.
Signed-off-by: Andrej Shadura <andrew.shadura@collabora.co.uk>
|
|
|
|
| |
They moved away from bitbucket some time ago.
|
|
|
|
|
|
| |
In theory it should no longer be needed, but PyPy hasn't
updated this part of their implementation yet, and not initing
threads will lead to crashes due to missing GIL init.
|
| |
|
|
|
|
|
|
| |
If it triggers it creates a blocking GUI dialog without any helpful output.
I can't reproduce the cause on my local machine, just on the CI server, so
jsut disable this for now.
|
|
|
|
|
| |
There are some glib deprecations that need fixing, but let's get
CI green again first.
|
|
|
|
|
| |
GObject Introspection renamed its default development branch to
"main".
|
|
|
|
|
|
|
|
|
|
| |
If C code calls g_object_new() for a GInitiallyUnowned subclass
implemented in python, the expectation is to receive a floating
reference.
The solution is used is the same picked for
5efe2e5c8458d9f4d72329ea1209d96b5ebecfb4, this is simply a special
case that was omitted at the time.
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
If gobject-introspection adds a new scope that we do not handle, we
should definitely not error out. Printing out a critical warning and
asking to file an issue should be enough.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On Python 3.10, the code raised an ImportWarning:
ImportWarning: DynamicImporter.find_spec() not found; falling back to find_module()
See https://docs.python.org/3.10/whatsnew/3.10.html#deprecated
> Starting in this release, there will be a concerted effort to begin cleaning
> up old import semantics that were kept for Python 2.7 compatibility.
> Specifically, find_loader()/find_module() (superseded by find_spec()),
> load_module() (superseded by exec_module()), module_repr()
> (which the import system takes care of for you),
> the __package__ attribute (superseded by __spec__.parent),
> the __loader__ attribute (superseded by __spec__.loader),
> and the __cached__ attribute (superseded by __spec__.cached)
> will slowly be removed (as well as other classes and methods in importlib).
> ImportWarning and/or DeprecationWarning will be raised as appropriate to help
> identify code which needs updating during this transition.
Fixes https://gitlab.gnome.org/GNOME/pygobject/-/issues/473
|
|
|
|
|
|
|
|
| |
It got renamed in gtk 4.1.0, see https://gitlab.gnome.org/GNOME/gtk/-/commit/a1216599ff6b39bca3e936fbf
To avoid an API break and make porting easier provide both versions for
all users.
Fixes #467
|