8 Commits

Author SHA1 Message Date
Pierre-Marie de Rodat
5aa1047d93 Update Python bindings after an internal Langkit-level API change 2026-01-14 15:03:44 +00:00
Pierre-Marie de Rodat
eab5ae7a8b Python API: fix charset handling for UnitProvider.auto
The low level function accepts a ctypes.c_char_p, which requires a bytes
instance, so users passing a str will get a TypeError exception. Use
the dedicated _unwrap_charset function to run the automatic conversion
in this case.

TN: VB02-014
2022-11-04 15:41:02 +00:00
Pierre-Marie de Rodat
a0f2f34ae7 Python API: fix UnitProvider.auto
The recent refactoring for GPR projects handling (#932) broke this
function. Do what is necessary to fix it.

TN: VB02-014
2022-11-04 15:41:02 +00:00
Pierre-Marie de Rodat
3c61ecd198 Python API: expose error messages from GPR project files
TN: VA14-036
2022-10-19 12:02:24 +00:00
Pierre-Marie de Rodat
b8d5e16c38 Python API: rework GPR projects handling
This commit introduces a new class that represents a loaded project
(GPRProject), created from the usual project loading arguments (project
file, scenario variables, target and RTS info). This new class provides
two methods: create_unit_provider(project=None) to create a unit
provider wrapping a project and source_files(mode) to query the list of
source files in a project.

It also removes the now obsolete SourceFiles class (recently added), but
preserves the UnitProvider.for_project method to avoid breaking existing
user code (been there for several years).

Closes #932
2022-07-18 13:14:27 +02:00
Pierre-Marie de Rodat
a2295945d5 Python bindings: remove support for Python2
TN: U720-016
2021-09-24 15:54:39 +02:00
Pierre-Marie de Rodat
3b2cc33db3 Project provider: introduce dedicated exception and clarify doc
This commit also switches custom exception to Langkit's new mechanism to
handle these automatically in all language bindings.

TN: U518-009
2021-06-23 17:09:59 +02:00
Pierre-Marie de Rodat
4382a22f9c Reorganize the source tree
Move most of "ada/*" to the root directory (this makes sense, as this
repository has been dedicated to Libadalang for years), and rename
"ada/language" to "ada".

TN: T914-010
2020-11-02 16:51:46 +01:00