From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-65-14.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00,FREEMAIL_FROM, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Received: by 2002:a05:6214:418d:b0:4c6:10ee:b758 with SMTP id ld13-20020a056214418d00b004c610eeb758mr3622100qvb.130.1668202441982; Fri, 11 Nov 2022 13:34:01 -0800 (PST) X-Received: by 2002:ae9:f70a:0:b0:6ee:830c:488a with SMTP id s10-20020ae9f70a000000b006ee830c488amr2750353qkg.596.1668202441767; Fri, 11 Nov 2022 13:34:01 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!news.mixmin.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 11 Nov 2022 13:34:01 -0800 (PST) In-Reply-To: Injection-Info: google-groups.googlegroups.com; posting-host=152.249.156.27; posting-account=TRgI1QoAAABSsYi-ox3Pi6N-JEKKU0cu NNTP-Posting-Host: 152.249.156.27 References: <7d578e15-d21e-4eae-a519-d98c1bf1145cn@googlegroups.com> <673c0ad1-dd6d-4cc6-a191-3bcff7f1c5ddn@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <6432f1f4-b641-4e21-9953-75b36f87c8e6n@googlegroups.com> Subject: Re: Running Python code from GPRBuild (Calling from GNAT Studio) From: "Rego, P." Injection-Date: Fri, 11 Nov 2022 21:34:01 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader01.eternal-september.org comp.lang.ada:64610 List-Id: > 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!