> 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!