comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Running Python code from GPRBuild (Calling from GNAT Studio)
Date: Fri, 11 Nov 2022 14:40:14 +0100	[thread overview]
Message-ID: <tkljbu$kfs$1@gioia.aioe.org> (raw)
In-Reply-To: tklipe$bk9$1@gioia.aioe.org

On 2022-11-11 14:30, Dmitry A. Kazakov wrote:
> On 2022-11-11 12:28, Rego, P. wrote:
> 
>> Got it. I didn't include naming and compiler options.
>> Now it runs, but it asks for a linker
>>> gprbuild: no linker specified and no default linker in the configuration
>> (where idk if it makes sense since we wont be linking to an object)
>>
>> For a no error py it "compiles" clean (ok I'll call compilation, but 
>> we understand
>> it's not "the compilation"), but in compilation log it doesn't show 
>> the warnings
>> that are included in the edit window with the opened file. If I include
>> an error, it shows in the log where the error happened, but doesn't 
>> show in
>> the locations. GPS will be not very useful this way.
> 
> This "compiles" only:
> 
> project Python is
>     for Languages use ("Python");
>     package Compiler is
>        for Driver ("Python") use 
> "C:/GNAT/2021/libexec/gnatstudio/gnathub/share/gnathub/python/python.exe";
>        for Required_Switches ("Python") use ("-m", "py_compile");
>     end Compiler;
>     package Naming is
>        for Body_Suffix ("Python") use ".py";
>     end Naming;
> end Python;
> 
> It should show syntax errors. If you remove -m py_compile switches, then 
> it will "compile" and execute.
> 
> (Python is not the thing you would wish to use in an IDE or anywhere, 
> pretty much consistently so... (:-))

Forgot to mention. If you want to create an executable. You can try to 
configure the package Linker using PyInstaller as the driver:

    https://pyinstaller.org/en/stable/operating-mode.html

Note that Linker does not take language e.g. ("Python") you just write:

    package Linker is
       for Driver use "pyinstaller.exe";

You have to tinker a bit since there is no object files to feed the 
Linker. Maybe you could sell it *.py as an "archive" (static library). 
Whatever... (:-))

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

  reply	other threads:[~2022-11-11 13:40 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-10 19:25 Running Python code from GPRBuild (Calling from GNAT Studio) Rego, P.
2022-11-10 21:57 ` Dmitry A. Kazakov
2022-11-11 10:25   ` Rego, P.
2022-11-11 11:04     ` Dmitry A. Kazakov
2022-11-11 11:28       ` Rego, P.
2022-11-11 13:30         ` Dmitry A. Kazakov
2022-11-11 13:40           ` Dmitry A. Kazakov [this message]
2022-11-11 18:12             ` Rego, P.
2022-11-11 18:08           ` Rego, P.
2022-11-11 19:50             ` Dmitry A. Kazakov
2022-11-11 21:34               ` Rego, P.
2022-11-11 15:20         ` Egil H H
2022-11-11 18:14           ` Rego, P.
2022-11-11 20:05             ` Egil H H
2022-11-11 21:24               ` Rego, P.
2022-11-12 17:40 ` Stephen Leake
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox