Re: Pythonmac-SIG Digest, Vol 189, Issue 3

Vincentius Vincentius <[email protected]> Tue, 5 Oct 2021 10:42:26 +1100
Newsgroups gmane.comp.python.apple
Message-ID <[email protected]>
--===============3087572450896956788==
Content-Type: multipart/alternative;
	boundary="Apple-Mail=_153158AF-27E2-4A2C-9D2A-E53AC618EC49"


--Apple-Mail=_153158AF-27E2-4A2C-9D2A-E53AC618EC49
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=utf-8

Thanks, yes, that is an option I=E2=80=99ve considered.  My applet =
already checks for required components and handles the download and =
install for the user (who only needs to provide admin credentials).

But, Apple=E2=80=99s recommendation is for developers to include a =
Python runtime with the app =
<https://developer.apple.com/documentation/macos-release-notes/macos-catal=
ina-10_15-release-notes#Scripting-Language-Runtimes>   I guess that's =
because apps can be finicky over which version of Python they require =
with as well as the range of modules required.  So, I=E2=80=99ve been =
working with the developer of the Python tool my applet uses to use =
PyInstaller to build a single file executable containing the script, =
Python and required modules.  That can be built by a GitHub YAML script =
and published for all Mac users.  It=E2=80=99ll probably be built to run =
on macOS 10.15 Catalina and Universal2 architecture.  My AS applet will =
then be able to download, install and use the executable in the same way =
as its existing components.

Cheers.


Garry
[email protected]

> On 5 Oct 2021, at 3:00 am, [email protected] wrote:
>=20
> Send Pythonmac-SIG mailing list submissions to
>=20
>   1. Re: How to include or install a Python runtime in an
>      AppleScript applet ([email protected])
>=20
> From: [email protected]
> Subject: Re: [Pythonmac-SIG] How to include or install a Python =
runtime in an AppleScript applet
> Date: 4 October 2021 at 10:04:10 am AEDT
> To: [email protected]
> Cc: [email protected], [email protected]
>=20
>=20
> Another option would be that the AppleScript checks whether the =
correct Python is installed (or maybe one of several usable Pythons, for =
example the official Python 3.x installer or a brew installation) and =
use that if it is. And if no suitable Python is found it could redirect =
the user to a web page with instructions on how to install a compatible =
Python.
>=20
> That is sort-of what Kevin suggests (Point users to a Python =
installation), but with a bit of automation added.
>=20
> Jack
>=20
>=20
>> On 2 Oct 2021, at 16:22, Kevin Walzer <[email protected] =
<mailto:[email protected]>> wrote:
>>=20
>>=20
>> On 9/28/21 1:12 AM, Vincentius Vincentius wrote:
>>>=20
>>> Can anyone help me with advice on how to create and distribute a =
Python runtime (with my applet) ?
>>>=20
>> Point your users to the installer for the Mac version of Python:
>>=20
>> https://www.python.org/ftp/python/3.9.7/python-3.9.7-macosx10.9.pkg =
<https://www.python.org/ftp/python/3.9.7/python-3.9.7-macosx10.9.pkg>
>> There is no simple way to embed a Python installation within an =
AppleScript applet. If you're doing that, you might as well all the way =
and deploy your script as a full Mac application with Python libraries =
bundled using a tool like py2app.=20
>>=20
>> --Kevin=20
>>=20
>> --=20
>> Kevin Walzer
>> Code by Kevin
>> http://www.codebykevin.com <http://www.codebykevin.com/>=

--Apple-Mail=_153158AF-27E2-4A2C-9D2A-E53AC618EC49
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=utf-8

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; =
charset=3Dutf-8"></head><body style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; line-break: after-white-space;" =
class=3D"">Thanks, yes, that is an option I=E2=80=99ve considered. =
&nbsp;My applet already checks for required components and handles the =
download and install for the user (who only needs to provide admin =
credentials).<div class=3D""><br class=3D""></div><div class=3D"">But, =
Apple=E2=80=99s recommendation is for&nbsp;<a =
href=3D"https://developer.apple.com/documentation/macos-release-notes/maco=
s-catalina-10_15-release-notes#Scripting-Language-Runtimes" =
class=3D"">developers to include a Python runtime with the app</a>&nbsp; =
&nbsp;I guess that's because apps can be finicky over which version of =
Python they require with as well as the range of modules required. =
&nbsp;So, I=E2=80=99ve been working with the developer of the Python =
tool my applet uses to use PyInstaller to build a single file executable =
containing the script, Python and required modules. &nbsp;That can be =
built by a GitHub YAML script and published for all Mac users. =
&nbsp;It=E2=80=99ll probably be built to run on macOS 10.15 Catalina and =
Universal2 architecture. &nbsp;My AS applet will then be able to =
download, install and use the executable in the same way as its existing =
components.</div><div class=3D""><br class=3D""></div><div =
class=3D"">Cheers.</div><div class=3D""><br class=3D""></div><div =
class=3D""><br class=3D""><div class=3D"">
<div style=3D"caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); =
font-family: &quot;Times New Roman&quot;; font-size: 16px; font-style: =
normal; font-variant-caps: normal; font-weight: normal; letter-spacing: =
normal; orphans: auto; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; widows: auto; word-spacing: =
0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; =
text-decoration: none;">Garry</div><div style=3D"caret-color: rgb(0, 0, =
0); color: rgb(0, 0, 0); font-family: &quot;Times New Roman&quot;; =
font-size: 16px; font-style: normal; font-variant-caps: normal; =
font-weight: normal; letter-spacing: normal; orphans: auto; text-align: =
start; text-indent: 0px; text-transform: none; white-space: normal; =
widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; =
-webkit-text-stroke-width: 0px; text-decoration: none;"><a =
href=3D"mailto:[email protected]" class=3D"">[email protected]</a></div>
</div>
<div><br class=3D""><blockquote type=3D"cite" class=3D""><div =
class=3D"">On 5 Oct 2021, at 3:00 am, <a =
href=3D"mailto:[email protected]" =
class=3D"">[email protected]</a> wrote:</div><br =
class=3D"Apple-interchange-newline"><div class=3D"">Send Pythonmac-SIG =
mailing list submissions to<br class=3D""><br class=3D""> &nbsp;&nbsp;1. =
Re: How to include or install a Python runtime in an<br class=3D""> =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;AppleScript applet (<a =
href=3D"mailto:[email protected]" class=3D"">[email protected]</a>)<br =
class=3D""><br class=3D""><div style=3D"margin-top: 0px; margin-right: =
0px; margin-bottom: 0px; margin-left: 0px;" class=3D""><span =
style=3D"font-family: -webkit-system-font, Helvetica Neue, Helvetica, =
sans-serif; color:rgba(127, 127, 127, 1.0);" class=3D""><b =
class=3D"">From: </b></span><span style=3D"font-family: =
-webkit-system-font, Helvetica Neue, Helvetica, sans-serif;" class=3D""><a=
 href=3D"mailto:[email protected]" class=3D"">[email protected]</a><br =
class=3D""></span></div><div style=3D"margin-top: 0px; margin-right: =
0px; margin-bottom: 0px; margin-left: 0px;" class=3D""><span =
style=3D"font-family: -webkit-system-font, Helvetica Neue, Helvetica, =
sans-serif; color:rgba(127, 127, 127, 1.0);" class=3D""><b =
class=3D"">Subject: </b></span><span style=3D"font-family: =
-webkit-system-font, Helvetica Neue, Helvetica, sans-serif;" class=3D""><b=
 class=3D"">Re: [Pythonmac-SIG] How to include or install a Python =
runtime in an AppleScript applet</b><br class=3D""></span></div><div =
style=3D"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; =
margin-left: 0px;" class=3D""><span style=3D"font-family: =
-webkit-system-font, Helvetica Neue, Helvetica, sans-serif; =
color:rgba(127, 127, 127, 1.0);" class=3D""><b class=3D"">Date: =
</b></span><span style=3D"font-family: -webkit-system-font, Helvetica =
Neue, Helvetica, sans-serif;" class=3D"">4 October 2021 at 10:04:10 am =
AEDT<br class=3D""></span></div><div style=3D"margin-top: 0px; =
margin-right: 0px; margin-bottom: 0px; margin-left: 0px;" class=3D""><span=
 style=3D"font-family: -webkit-system-font, Helvetica Neue, Helvetica, =
sans-serif; color:rgba(127, 127, 127, 1.0);" class=3D""><b class=3D"">To: =
</b></span><span style=3D"font-family: -webkit-system-font, Helvetica =
Neue, Helvetica, sans-serif;" class=3D""><a =
href=3D"mailto:[email protected]" class=3D"">[email protected]</a><br =
class=3D""></span></div><div style=3D"margin-top: 0px; margin-right: =
0px; margin-bottom: 0px; margin-left: 0px;" class=3D""><span =
style=3D"font-family: -webkit-system-font, Helvetica Neue, Helvetica, =
sans-serif; color:rgba(127, 127, 127, 1.0);" class=3D""><b class=3D"">Cc: =
</b></span><span style=3D"font-family: -webkit-system-font, Helvetica =
Neue, Helvetica, sans-serif;" class=3D""><a =
href=3D"mailto:[email protected]" =
class=3D"">[email protected]</a>, <a =
href=3D"mailto:[email protected]" class=3D"">[email protected]</a><br =
class=3D""></span></div><br class=3D""><br class=3D""><meta =
http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii" =
class=3D""><div style=3D"word-wrap: break-word; -webkit-nbsp-mode: =
space; line-break: after-white-space;" class=3D""><div class=3D"">Another =
option would be that the AppleScript checks whether the correct Python =
is installed (or maybe one of several usable Pythons, for example the =
official Python 3.x installer or a brew installation) and use that if it =
is. And if no suitable Python is found it could redirect the user to a =
web page with instructions on how to install a compatible =
Python.</div><div class=3D""><br class=3D""></div><div class=3D"">That =
is sort-of what Kevin suggests (Point users to a Python installation), =
but with a bit of automation added.</div><div class=3D""><br =
class=3D""></div><div class=3D"">Jack</div><div class=3D""><br =
class=3D""><div class=3D""><br class=3D""><blockquote type=3D"cite" =
class=3D""><div class=3D"">On 2 Oct 2021, at 16:22, Kevin Walzer &lt;<a =
href=3D"mailto:[email protected]" class=3D"">[email protected]</a>&gt; =
wrote:</div><br class=3D"Apple-interchange-newline"><div class=3D"">
 =20
    <meta http-equiv=3D"Content-Type" content=3D"text/html; =
charset=3DUTF-8" class=3D"">
 =20
  <div class=3D"">
    <div class=3D"moz-cite-prefix"><br class=3D"">
    </div>
    <div class=3D"moz-cite-prefix">On 9/28/21 1:12 AM, Vincentius
      Vincentius wrote:<br class=3D"">
    </div>
    <blockquote type=3D"cite" =
cite=3D"mid:[email protected]" class=3D"">
      <meta http-equiv=3D"Content-Type" content=3D"text/html; =
charset=3DUTF-8" class=3D"">
      <div class=3D"">
        <div class=3D"" style=3D"caret-color: rgb(0, 0, 0); font-family: =
TimesNewRomanPSMT;"><br class=3D"">
        </div>
        <div class=3D"" style=3D"caret-color: rgb(0, 0, 0); font-family: =
TimesNewRomanPSMT;">Can anyone help me with
          advice on how to create and distribute a Python runtime (with
          my applet) ?</div>
      </div>
      <div class=3D""><br class=3D"">
      </div>
    </blockquote><p class=3D"">Point your users to the installer for the =
Mac version of Python:</p><p class=3D""><a class=3D"moz-txt-link-freetext"=
 =
href=3D"https://www.python.org/ftp/python/3.9.7/python-3.9.7-macosx10.9.pk=
g">https://www.python.org/ftp/python/3.9.7/python-3.9.7-macosx10.9.pkg</a>=
</p><p class=3D"">There is no simple way to embed a Python installation =
within an
      AppleScript applet. If you're doing that, you might as well all
      the way and deploy your script as a full Mac application with
      Python libraries bundled using a tool like py2app. <br class=3D"">
    </p><p class=3D"">--Kevin <br class=3D"">
    </p>
    <pre class=3D"moz-signature" cols=3D"72">--=20
Kevin Walzer
Code by Kevin
<a class=3D"moz-txt-link-freetext" =
href=3D"http://www.codebykevin.com">http://www.codebykevin.com</a></pre></=
div></div></blockquote></div></div></div></div></blockquote></div></div></=
body></html>=

--Apple-Mail=_153158AF-27E2-4A2C-9D2A-E53AC618EC49--

--===============3087572450896956788==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Pythonmac-SIG maillist  -  [email protected]
https://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: https://mail.python.org/mailman/options/Pythonmac-SIG

--===============3087572450896956788==--