comp.lang.ada
 help / color / mirror / Atom feed
From: "Rego, P." <pvrego@gmail.com>
Subject: Re: Running Python code from GPRBuild (Calling from GNAT Studio)
Date: Fri, 11 Nov 2022 13:34:01 -0800 (PST)	[thread overview]
Message-ID: <6432f1f4-b641-4e21-9953-75b36f87c8e6n@googlegroups.com> (raw)
In-Reply-To: <tkm91g$t7f$1@gioia.aioe.org>

> 1. for Required_Switches ("Python") use ("-m", "py_compile"); 
> 2. for Required_Switches ("Python") use ("-m", "compileall"); 
> 3. nothing 

Tried all the options, varing w/wo "-m". Not much exciting.

Current version is 
--
project Testpy is
   for Source_Dirs use ("src");
   for Object_Dir use "obj";
   for Languages use ("python");
   for Objects_Linked ("python") use "False";
   for Object_Generated ("python") use "False";

   for Source_Files use ("Analysis.py");
   for Main use ("Analysis.py");

   package Naming is
      for Body_Suffix ("python") use ".py";
   end Naming;

   package Compiler is
      for Driver ("python") use "C:\GNAT\2021\libexec\gnatstudio\gnathub\share\gnathub\python\python.exe";
      --  for Required_Switches ("python") use ("-m", "compileall");
      --  for Required_Switches ("Python") use ("-m", "py_compile");
      for Required_Switches ("Python") use ("-m","py_compile");
   end Compiler;

   package Linker is
      for Driver use "C:\GNAT\2021\libexec\gnatstudio\gnathub\share\gnathub\python\python.exe";
   end Linker;

   for Object_Generated("Python") use "False";
   for Objects_Linked("Python") use "False";

end Testpy;
--

Curiosily, compiling Analysis.py with 
# Analysis.py
import os
import sys

print('test')
blabla

(so obviously it should not compile), returns no error

gprbuild -ws -c -f -u -PP:\Gnat\testpy.gpr Analysis.py
Compile
   [python]       analysis.py
[2022-11-11 18:27:03] process terminated successfully, elapsed time: 03.58s

But no problem. I'm convinced that Python (as external code, not GPS internal 
script) should be kept very far from GPS. 

Thanks!

  reply	other threads:[~2022-11-11 21:34 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
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. [this message]
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