| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| |
| |
| | |
Add basic mypy support; Require Python 3.5
See merge request GNOME/gobject-introspection!251
|
| |
| |
| |
| |
| |
| | |
Silence some errors, run mypy in CI
Adding annotations to functions/classes will make mypy check them.
|
|\ \
| | |
| | |
| | |
| | | |
giscanner: always define PY_SSIZE_T_CLEAN
See merge request GNOME/gobject-introspection!244
|
| | |
| | |
| | |
| | | |
This is required for Python 3.10 and always a good idea anyway.
|
|\ \ \
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Don't assume Py_TYPE being a macro
Closes #358
See merge request GNOME/gobject-introspection!243
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | | |
It got changed to a function in Python 3.10. Use the Py_SET_TYPE macro
suggested at https://docs.python.org/3.10/whatsnew/3.10.html instead.
Fixes #358
|
|\ \ \
| | | |
| | | |
| | | |
| | | | |
open cleanup: explicit encoding, close fds
See merge request GNOME/gobject-introspection!250
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This means flushing changes and closing the fd. Otherwise this is done
by the GC eventually..
Detected using PYTHONTRACEMALLOC=1 PYTHONDEVMODE=1
|
| | |/
| |/|
| | |
| | |
| | |
| | |
| | |
| | | |
Otherwise we'll end up using the locale encoding. While it's usually utf-8,
that's not the case on Windows.
There is one place where a file with filenames is passed, not sure there
so I left it and passed a explicit None.
|
|/ /
| |
| |
| |
| | |
From what I can see this was used for importing the C ext in an uninstalled
libtool build of g-i. We no longer use libtool, so this is no longer needed.
|
|/ |
|
|
|
|
|
|
|
|
|
| |
This reverts commit de6512b31b614567bf1800406303d1ccfb6d9455.
This was causing naming conflicts when the SECTION documentation
was picked over the class documentation.
See https://gitlab.gnome.org/GNOME/gobject-introspection/-/issues/360
|
|
|
|
|
|
|
|
|
| |
os.path.relpath() will throw a ValueError when the two paths that
are fed to it are on different drives, at least when running under
cmd.exe consoles.
Fix this by falling back to the full path when this ValueError is
thrown.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When writing documentation to the GIR files, GIR tries to match
classes with their matching SECTION: comment in the source code. Some codebases
use kebab-case or CamelCase for their section names, but GIR always expects
them to be flatcase or the matching will fail.
This commit converts all section names to flatcase (by removing "-" and
converting to lowercase) while they are being parsed, so that they are matched
properly later on.
Fixes #350.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds quick support for using 'clang-cl' (CLang's emulation of the Visual
Studio compiler) to run giscanner.
This will still initialize things mostly in the MSVC fashion, except that it
will also check whether both 'CC' and 'CXX' envvars are set to
'clang-cl [args]', as per the way that Meson supports using 'clang-cl'.
Since we are using distutils to set up the compiler instance, when we enable
'clang-cl' support, we trick distutils that we have already initialized the
MSVCCompiler parameters as needed. We just leave out the compiler flags as
we don't really care about debug symbols nor optimization with the built
dumper binary, as it is gone as soon as the .gir file is generated.
This will build G-I successfully with all the tests passed.
|
|\
| |
| |
| |
| | |
Add the notion of standalone doc sections.
See merge request GNOME/gobject-introspection!226
|
| |
| |
| |
| |
| |
| |
| |
| | |
Up to now, section annotations had to match a class or interface
name in order to be serialized in the gir.
With this commit, they now get serialized as docsection nodes,
for potential use by documentation tools.
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There was previously no mechanism for tagging enum members
and struct fields with Since tags (or other, eg deprecation tags).
While the customary place to add Since tags for these symbols
is inline in the parent symbol's documentation eg:
/**
* Foo:
*
* @FOO_BAR: some bar. Since X.Y
*/
And variations on that theme, implementing parsing for that scheme
would result in a pretty ambiguous grammar, especially if we also
want support for multiple tags.
Instead, the solution implemented here is to allow providing
documentation for individual members and fields through their
own separate block, as is done for virtual functions already.
Inline comments are still used, with a lower precedence.
Fixes #348
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
settings
In case a user had a combination of -fvisibility=hidden, -Wl,--as-needed, -flto, -O2
in the CFLAGS the linker would sometimes detect that all the referenced gtype functions
weren't actually used and throw them out with their providing libraries.
Instead of hoping that the user's CFLAGS don't mess without our symbol visibility just use
G_MODULE_EXPORT on the two symbols which reference all other gtype and gquark symbols.
This fixes errors such as:
Invalid GType function: 'gtk_accel_group_get_type'
Failed to find symbol 'gtk_accel_group_get_type'
during the g-ir-scanner execution.
Fixes #280
|
|
|
|
| |
The newest flake8 has started to detect this.
|
| |
|
|
|
|
|
|
| |
Breaks vapigen and changes GListModel definition in Gio-2.0.gir
This reverts commit a9f45431684e6be3623e272e54d481e4c5d9423d.
|
|
|
|
|
|
|
|
| |
GListModel is an interface for creating typed, list-like containers. The
data stored is GObject instances, but it's useful to be able to annotate
the actual type, for both documentation and code generation purposes.
The annotation should be optional, to maintain backward compatibility.
|
|
|
|
|
|
| |
This reverts commit b4c058bba4d95ae10e1e4238f9417fe954f97795.
See: #336
|
|
|
|
|
|
| |
This reverts commit ffe3e435e0b7943a0872034223b5f6ea02258ffa.
See: #336
|
|
|
|
|
|
| |
We need to special case the ListModel container type in the
documentation writer so that we don't fall back into array/list
automatic conversion in the code snippets.
|
|
|
|
|
|
|
|
| |
GListModel is an interface for creating typed, list-like containers. The
data stored is GObject instances, but it's useful to be able to annotate
the actual type, for both documentation and code generation purposes.
Fixes: #328
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
GTK4 allows adding widget-related actions to the documentation with the
newly defined syntax:
<class_name> '|' <action_name> ':'
This means g-ir-scanner needs to detect this new format, to avoid
emitting unnecessary warnings.
Currently, we don't do anything with the actions; in the future we might
want to add them to the documentation in the GIR, but for that we'd need
a new element.
See also: GNOME/gtk-doc!30
|
|
|
|
|
|
|
|
|
| |
cElementTree was removed in Python 3.9 in favor of ElementTree,
which has used a fast, native implementation since Python 3.3.
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1817649
Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Python 3.8.x and later changed the way how dependent DLLs can be found for a
given Python module that depends on the presence of external, non-system DLLs,
for more fine-grained DLLs searching and loading, as well as for security
purposes, which required the use of os.add_dll_directory().
Thus, the scripts in scanner/ must be updated such that:
-We are able to find and load the GObject and GLib DLLs, at least, on
initialization, via the use of 'pkg-config --variable bindir', as we already
depend on the GLib DLLs. Note that since the gobject-2.0.pc file does not
have a 'bindir' entry, we use gio-2.0.pc instead to discover the bindir of the
GObject and GLib DLLs. Likewise, we use the same technique for pkg-config
files that are dependent upon when using g-ir-scanner (or friends) on items
that are higher up in the stack.
-We are able to find any other DLLs (e.g. non-GNOME DLLs such as ZLib) that
are dependent but are not found in the path(s) given by 'pkg-config --variable
bindir' with the envvar GI_EXTRA_BASE_DLL_DIRS, as needed. Note that
GI_EXTRA_BASE_DLL_DIRS can be multiple paths, and that the results from
'pkg-config --variable bindir' takes precendence, in a LIFO manner.
|
|
|
|
|
|
|
|
|
| |
The XML elements are implicitly iterable in all Python versions including
at least 2.7 and 3.2+.
The .getchildren() method is deprecated since 2.7 and 3.2, removed in 3.9.
Fixes https://gitlab.gnome.org/GNOME/gobject-introspection/issues/325
|
|
|
|
|
|
|
|
|
|
| |
By default LD_LIBRARY_PATH is set to the list of target library paths;
this breaks down in cross-compilation environment, as we need to run a
native emulation wrapper rather than the target binary itself. This patch
allows exporting those paths to a different environment variable
which can be picked up and used by the wrapper.
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
|
|
|
|
|
|
|
| |
This is useful in cross-compile environments where system's ldd
command does not work on binaries built for a different architecture
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
|
|
|
|
|
|
|
|
|
| |
With this option, giscanner will use a wrapper executable to run
binaries it's producing, instead of running them directly. This
is useful when binaries are cross-compiled and cannot be run directly,
but they can be run using for example QEMU emulation.
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
|
|
|
|
| |
warning: deprecated directive, use ‘%define parse.error verbose’
|
|
|
|
|
|
|
|
|
|
|
|
| |
When we save the macros to pass to distutils to compile the dumper
program, the quotes were not properly preserved for Visual Studio
builds, causing items such as -DG_LOG_DOMAIN to fail as quotes are used
in there.
When we use quotes in macro definitions, we escape the escape
character in ccompiler._set_cpp_options() when we are running
g-ir-scanner with Visual Studio, so that distutils won't be too eager
to drop those prematurely.
|
|
|
|
|
|
|
|
|
|
| |
In Python 3, filter() returns a filter object for lazy evaluation.
This object is truthy, so casting it to bool will return True even
if it would contain no objects. This thwarts the test at the
beginning of _resolve_non_libtool. To fix this, immediately
evaluate the filters with list().
Fixes #314.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
C99 allows defining an array argument with a fixed size as:
void foo (int arr[static 10])
Compilers conforming to the C99 specification will be able to warn if
the function is called with NULL or with an array smaller than the
specified length, something that does not happen when using pre-C99
declarations like:
void foo (int arr[10])
As the declaration above is identical to:
void foo (int arr[])
Which is, in turn, identical to:
void foo (int *arr)
Fixes: #309
|
|
|
|
|
|
|
| |
Add some missing `meson.override_find_program`
And make sure that the `.gir` we build are found when used uninstalled
as a concequence of `meson.override_find_program`.
|
|
|
|
|
| |
No need to hardcode things since distutils looks it up.
Similar to !170 but for Windows.
|
|
|
|
| |
Closes: https://gitlab.gnome.org/GNOME/gobject-introspection/issues/303
|
|
|
|
|
|
|
| |
For some reason there is no way to pass required to external meson deps.
Check manually instead.
See #297
|
|
|
|
|
|
|
|
|
|
| |
In our case it was never needed because it defaults to true if install_dir is set,
which it always is for all calls.
This avoids a warning when running with newer meson where it complains that install
is only available with 0.50+.
Fixes #298
|
|
|
|
|
| |
We already do the same thing for constants (see _create_const()).
Otherwise macros in .c files which aren't namespaced will trigger a warning.
|
|
|
|
|
| |
This is useful for documentation tools, and other utilities that
rely on full introspection of the C API of a given library.
|
|
|
|
|
|
|
|
|
|
| |
By doing so, we essentially cover the various compiler flags that we
want to use for non-Visual Studio builds to check for warnings that
might cause real concern.
This also skips the checks for the various GCC-isque CFlag checks that
are scattered in the various build files on Visual Studio builds, since
they are essentially meaningless on Visual Studio builds.
|
|
|
|
|
|
|
|
| |
This is to compensate the for the lack of unistd.h on Visual Studio
builds, and to avoid the compiler warning about the implicit declaration
of access() as a result. This is to also prepare for the next commit
when we force-include msvc_recommended_pragmas.h from GLib on Visual
Studio builds.
|
|
|
|
|
|
|
|
|
| |
os.path.commonpath() raises ValueError if the paths given to it are on different
drives.
Handle that case by giving up and add a test.
Reported here: https://github.com/msys2/MINGW-packages/pull/5258#issuecomment-485230864
|
|
|
|
|
|
|
|
| |
In the unlucky event where the cache gets deleted after the os.path.exists()
check but before we get its mtime things would error out.
Instead of using os.path.exists() handle the exceptions of the operations
which we expect to possibly fail.
|
|
|
|
| |
This is apparently used in Gee-0.8 and Folks-0.6.
|