Re: "pythonw" in a Unix build

Ronald Oussoren via Pythonmac-SIG <[email protected]> Mon, 18 Jan 2021 10:33:51 +0100
Newsgroups gmane.comp.python.apple
Message-ID <[email protected]>
--===============0257891887314056628==
Content-Type: multipart/alternative;
	boundary="Apple-Mail=_EF297C2D-3927-44A7-BB16-39F72129A9E3"


--Apple-Mail=_EF297C2D-3927-44A7-BB16-39F72129A9E3
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=utf-8



> On 15 Jan 2021, at 06:24, Christopher Barker <[email protected]> =
wrote:
>=20
> On Thu, Jan 14, 2021 at 3:14 PM Jack Jansen <[email protected] =
<mailto:[email protected]>> wrote:
> For example, the brew Python is installed into a framework tucked away =
deep in /usr/local/Cellar but you don=E2=80=99t notice this at all: you =
can just use =E2=80=9Cpython foo.py=E2=80=9D and the moment the script =
does GUI calls it=E2=80=99ll get an icon in the doc and all that.
>=20
> What problem are you trying to solve?
>=20
> It's interesting that brew python has decided to use a Framework build =
....
>=20
> But the problem at hand is conda python which used a plain unix build.

Maybe they should switch to a framework build instead :-)

>=20
> They have provided a shell script "pythonw" that re-directs to a =
python inside an app bundle, and that works OK on the command line, but =
it does not work with, e.g. setuptools entry points.
>=20
> I could dig up the threads, but this has been discussed on this list, =
and few gitHub issues.=20

As mentioned on python-dev adding the =E2=80=9Cpythonw=E2=80=9D =
functionality to the unix build is not very hard. I expect that =
integrating with the build system (Makefile/configure script) will be =
the hardest part due to introducing different behaviour for the macOS =
platform.=20

>=20
> In short, there are a few ways to work around these issues, but no one =
(the conda people, the setuptools devs) wants to put the kludgy work =
around in their code.
>=20
> And we already have a work around in the core python code, it's just =
that the build system needs to be set up to build it outside of a =
Framework.

The framework build does not have a workaround for these problems, it =
has a proper solution ;-).=20

Ronald

>=20
> -CHB
>=20
>=20
> =20
> Jack
>=20
>> On  14-Jan-2021, at 23:07 , Chris Barker via Pythonmac-SIG =
<[email protected] <mailto:[email protected]>> wrote:
>>=20
>> Ned suggested I bring this conversation over here from python-dev, so =
here it is.
>>=20
>> What I'd like to see done is have the "pythonw" wrapper buildable in =
an otherwise non-framework build.
>>=20
>> I *think* there are no real technical show stoppers, but it would =
take some auto-conf magic, which I am fully unqualified to take on.
>>=20
>> Anyone interested in helping make this happen ?
>>=20
>> -CHB
>>=20
>>=20
>> --=20
>>=20
>> Christopher Barker, Ph.D.
>> Oceanographer
>>=20
>> Emergency Response Division
>> NOAA/NOS/OR&R            (206) 526-6959   voice
>> 7600 Sand Point Way NE   (206) 526-6329   fax
>> Seattle, WA  98115       (206) 526-6317   main reception
>>=20
>> [email protected] =
<mailto:[email protected]>____________________________________________=
___
>> Pythonmac-SIG maillist  -  [email protected] =
<mailto:[email protected]>
>> https://mail.python.org/mailman/listinfo/pythonmac-sig =
<https://mail.python.org/mailman/listinfo/pythonmac-sig>
>> unsubscribe: https://mail.python.org/mailman/options/Pythonmac-SIG =
<https://mail.python.org/mailman/options/Pythonmac-SIG>
>=20
> --
> Jack Jansen, <[email protected] <mailto:[email protected]>>, =
http://www.cwi.nl/~jack <http://www.cwi.nl/~jack>
> If I can't dance I don't want to be part of your revolution -- Emma =
Goldman
>=20
>=20
>=20
> _______________________________________________
> Pythonmac-SIG maillist  -  [email protected] =
<mailto:[email protected]>
> https://mail.python.org/mailman/listinfo/pythonmac-sig =
<https://mail.python.org/mailman/listinfo/pythonmac-sig>
> unsubscribe: https://mail.python.org/mailman/options/Pythonmac-SIG =
<https://mail.python.org/mailman/options/Pythonmac-SIG>
>=20
>=20
> --=20
> Christopher Barker, PhD (Chris)
>=20
> Python Language Consulting
>   - Teaching
>   - Scientific Software Development
>   - Desktop GUI and Web Development
>   - wxPython, numpy, scipy, Cython
> _______________________________________________
> Pythonmac-SIG maillist  -  [email protected] =
<mailto:[email protected]>
> https://mail.python.org/mailman/listinfo/pythonmac-sig =
<https://mail.python.org/mailman/listinfo/pythonmac-sig>
> unsubscribe: https://mail.python.org/mailman/options/Pythonmac-SIG =
<https://mail.python.org/mailman/options/Pythonmac-SIG>
=E2=80=94

Twitter / micro.blog: @ronaldoussoren
Blog: https://blog.ronaldoussoren.net/


--Apple-Mail=_EF297C2D-3927-44A7-BB16-39F72129A9E3
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""><br =
class=3D""><div><br class=3D""><blockquote type=3D"cite" class=3D""><div =
class=3D"">On 15 Jan 2021, at 06:24, Christopher Barker &lt;<a =
href=3D"mailto:[email protected]" class=3D"">[email protected]</a>&gt;=
 wrote:</div><br class=3D"Apple-interchange-newline"><div class=3D""><meta=
 charset=3D"UTF-8" class=3D""><div dir=3D"ltr" style=3D"caret-color: =
rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: =
normal; font-variant-caps: normal; font-weight: normal; letter-spacing: =
normal; text-align: start; text-indent: 0px; text-transform: none; =
white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none;" class=3D""><div dir=3D"ltr" class=3D"">On Thu, =
Jan 14, 2021 at 3:14 PM Jack Jansen &lt;<a =
href=3D"mailto:[email protected]" class=3D"">[email protected]</a>&gt; =
wrote:<br class=3D""></div><div class=3D"gmail_quote"><blockquote =
class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; =
border-left-width: 1px; border-left-style: solid; border-left-color: =
rgb(204, 204, 204); padding-left: 1ex;"><div style=3D"overflow-wrap: =
break-word;" class=3D"">For example, the brew Python is installed into a =
framework tucked away deep in /usr/local/Cellar but you don=E2=80=99t =
notice this at all: you can just use =E2=80=9Cpython foo.py=E2=80=9D and =
the moment the script does GUI calls it=E2=80=99ll get an icon in the =
doc and all that.<div class=3D""><br class=3D""></div><div class=3D"">What=
 problem are you trying to solve?</div></div></blockquote><div =
class=3D""><br class=3D""></div><div class=3D"">It's interesting that =
brew python has decided to use a Framework build ....</div><div =
class=3D""><br class=3D""></div><div class=3D"">But the problem at hand =
is conda python which used a plain unix =
build.</div></div></div></div></blockquote><div><br class=3D""></div>Maybe=
 they should switch to a framework build instead :-)</div><div><br =
class=3D""><blockquote type=3D"cite" class=3D""><div class=3D""><div =
dir=3D"ltr" style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; =
font-size: 12px; font-style: normal; font-variant-caps: normal; =
font-weight: normal; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none;" class=3D""><div class=3D"gmail_quote"><div class=3D""><br =
class=3D""></div><div class=3D"">They have provided a shell script =
"pythonw" that re-directs to a python inside an app bundle, and that =
works OK on the command line, but it does not work with, e.g. setuptools =
entry points.</div><div class=3D""><br class=3D""></div><div class=3D"">I =
could dig up the threads, but this has been discussed on this list, and =
few gitHub issues.<span class=3D"Apple-converted-space">&nbsp;</span><br =
class=3D""></div></div></div></div></blockquote><div><br =
class=3D""></div>As mentioned on python-dev adding the =E2=80=9Cpythonw=E2=
=80=9D functionality to the unix build is not very hard. I expect that =
integrating with the build system (Makefile/configure script) will be =
the hardest part due to introducing different behaviour for the macOS =
platform.&nbsp;</div><div><br class=3D""><blockquote type=3D"cite" =
class=3D""><div class=3D""><div dir=3D"ltr" style=3D"caret-color: rgb(0, =
0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: normal; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none;" class=3D""><div class=3D"gmail_quote"><div =
class=3D""><br class=3D""></div><div class=3D"">In short, there are a =
few ways to work around these issues, but no one (the conda people, the =
setuptools devs) wants to put the kludgy work around in their =
code.</div></div></div></div></blockquote><blockquote type=3D"cite" =
class=3D""><div class=3D""><div dir=3D"ltr" style=3D"caret-color: rgb(0, =
0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: normal; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none;" class=3D""><div class=3D"gmail_quote"><div =
class=3D""><br class=3D""></div><div class=3D"">And we already have a =
work around in the core python code, it's just that the build system =
needs to be set up to build it outside of a =
Framework.</div></div></div></div></blockquote><div><br =
class=3D""></div>The framework build does not have a workaround for =
these problems, it has a proper solution ;-).&nbsp;</div><div><br =
class=3D""></div><div>Ronald</div><div><br class=3D""><blockquote =
type=3D"cite" class=3D""><div class=3D""><div dir=3D"ltr" =
style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: =
12px; font-style: normal; font-variant-caps: normal; font-weight: =
normal; letter-spacing: normal; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; text-decoration: none;" class=3D""><div =
class=3D"gmail_quote"><div class=3D""><br class=3D""></div><div =
class=3D"">-CHB</div><div class=3D""><br class=3D""></div><div =
class=3D""><br class=3D""></div><div class=3D"">&nbsp;</div><blockquote =
class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; =
border-left-width: 1px; border-left-style: solid; border-left-color: =
rgb(204, 204, 204); padding-left: 1ex;"><div style=3D"overflow-wrap: =
break-word;" class=3D""><div class=3D"">Jack</div><div class=3D""><br =
class=3D""><blockquote type=3D"cite" class=3D""><div class=3D"">On =
&nbsp;14-Jan-2021, at 23:07 , Chris Barker via Pythonmac-SIG &lt;<a =
href=3D"mailto:[email protected]" target=3D"_blank" =
class=3D"">[email protected]</a>&gt; wrote:</div><br =
class=3D""><div class=3D""><div dir=3D"ltr" class=3D"">Ned suggested I =
bring this conversation over here from python-dev, so here it is.<div =
class=3D""><br class=3D""></div><div class=3D"">What I'd like to see =
done is have the "pythonw" wrapper buildable in an otherwise =
non-framework build.</div><div class=3D""><br class=3D""></div><div =
class=3D"">I *think* there are no real technical show stoppers, but it =
would take some auto-conf magic, which I am fully unqualified to take =
on.</div><div class=3D""><br class=3D""></div><div class=3D"">Anyone =
interested in helping make this happen ?</div><div class=3D""><br =
class=3D""></div><div class=3D"">-CHB</div><div class=3D""><br =
class=3D""></div><div class=3D""><div class=3D""><br =
class=3D""></div>--<span class=3D"Apple-converted-space">&nbsp;</span><br =
class=3D""><div dir=3D"ltr" class=3D""><br class=3D"">Christopher =
Barker, Ph.D.<br class=3D"">Oceanographer<br class=3D""><br =
class=3D"">Emergency Response Division<br class=3D"">NOAA/NOS/OR&amp;R =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(206) 526-6959&nbsp;&nbsp; =
voice<br class=3D"">7600 Sand Point Way NE &nbsp;&nbsp;(206) =
526-6329&nbsp;&nbsp; fax<br class=3D"">Seattle, WA &nbsp;98115 &nbsp; =
&nbsp; &nbsp;&nbsp;(206) 526-6317&nbsp;&nbsp; main reception<br =
class=3D""><br class=3D""><a href=3D"mailto:[email protected]" =
target=3D"_blank" =
class=3D"">[email protected]</a></div></div></div>____________________=
___________________________<br class=3D"">Pythonmac-SIG maillist &nbsp;- =
&nbsp;<a href=3D"mailto:[email protected]" target=3D"_blank" =
class=3D"">[email protected]</a><br class=3D""><a =
href=3D"https://mail.python.org/mailman/listinfo/pythonmac-sig" =
target=3D"_blank" =
class=3D"">https://mail.python.org/mailman/listinfo/pythonmac-sig</a><br =
class=3D"">unsubscribe:<span =
class=3D"Apple-converted-space">&nbsp;</span><a =
href=3D"https://mail.python.org/mailman/options/Pythonmac-SIG" =
target=3D"_blank" =
class=3D"">https://mail.python.org/mailman/options/Pythonmac-SIG</a><br =
class=3D""></div></blockquote></div><br class=3D""><div class=3D""><span =
style=3D"border-collapse: separate; font-family: Helvetica; font-size: =
12px; font-style: normal; font-variant-ligatures: normal; =
font-variant-caps: normal; font-variant-east-asian: normal; =
font-variant-position: normal; font-weight: normal; letter-spacing: =
normal; line-height: normal; text-indent: 0px; text-transform: none; =
white-space: normal; word-spacing: 0px;" class=3D""><div class=3D""><div =
style=3D"margin: 0px;" class=3D""><font size=3D"3" face=3D"Helvetica" =
style=3D"font-style: normal; font-variant-caps: normal; font-weight: =
normal; font-stretch: normal; font-size: 12px; line-height: normal; =
font-family: Helvetica;" class=3D"">--</font></div><div style=3D"margin: =
0px;" class=3D""><font size=3D"3" face=3D"Helvetica" style=3D"font-style: =
normal; font-variant-caps: normal; font-weight: normal; font-stretch: =
normal; font-size: 12px; line-height: normal; font-family: Helvetica;" =
class=3D"">Jack Jansen, &lt;<a href=3D"mailto:[email protected]" =
target=3D"_blank" class=3D"">[email protected]</a>&gt;,<span =
class=3D"Apple-converted-space">&nbsp;</span><a =
href=3D"http://www.cwi.nl/~jack" target=3D"_blank" =
class=3D"">http://www.cwi.nl/~jack</a></font></div><div style=3D"margin: =
0px;" class=3D""><font size=3D"3" face=3D"Helvetica" style=3D"font-style: =
normal; font-variant-caps: normal; font-weight: normal; font-stretch: =
normal; font-size: 12px; line-height: normal; font-family: Helvetica;" =
class=3D"">If I can't dance I don't want to be part of your revolution =
-- Emma Goldman</font></div><br class=3D""></div></span><br =
class=3D""></div><br =
class=3D""></div>_______________________________________________<br =
class=3D"">Pythonmac-SIG maillist&nbsp; -&nbsp;<span =
class=3D"Apple-converted-space">&nbsp;</span><a =
href=3D"mailto:[email protected]" target=3D"_blank" =
class=3D"">[email protected]</a><br class=3D""><a =
href=3D"https://mail.python.org/mailman/listinfo/pythonmac-sig" =
rel=3D"noreferrer" target=3D"_blank" =
class=3D"">https://mail.python.org/mailman/listinfo/pythonmac-sig</a><br =
class=3D"">unsubscribe:<span =
class=3D"Apple-converted-space">&nbsp;</span><a =
href=3D"https://mail.python.org/mailman/options/Pythonmac-SIG" =
rel=3D"noreferrer" target=3D"_blank" =
class=3D"">https://mail.python.org/mailman/options/Pythonmac-SIG</a><br =
class=3D""></blockquote></div><br clear=3D"all" class=3D""><br =
class=3D"">--<span class=3D"Apple-converted-space">&nbsp;</span><br =
class=3D""><div dir=3D"ltr" class=3D"gmail_signature"><div dir=3D"ltr" =
class=3D"">Christopher Barker, PhD (Chris)<br class=3D""><br =
class=3D"">Python Language Consulting<br class=3D"">&nbsp; - Teaching<br =
class=3D"">&nbsp; - Scientific Software Development<br class=3D"">&nbsp; =
- Desktop GUI and Web Development<br class=3D"">&nbsp; - wxPython, =
numpy, scipy, Cython<br class=3D""></div></div></div><span =
style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: =
12px; font-style: normal; font-variant-caps: normal; font-weight: =
normal; letter-spacing: normal; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; text-decoration: none; float: none; =
display: inline !important;" =
class=3D"">_______________________________________________</span><br =
style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: =
12px; font-style: normal; font-variant-caps: normal; font-weight: =
normal; letter-spacing: normal; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; text-decoration: none;" class=3D""><span =
style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: =
12px; font-style: normal; font-variant-caps: normal; font-weight: =
normal; letter-spacing: normal; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; text-decoration: none; float: none; =
display: inline !important;" class=3D"">Pythonmac-SIG maillist &nbsp;- =
&nbsp;</span><a href=3D"mailto:[email protected]" =
style=3D"font-family: Helvetica; font-size: 12px; 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;" =
class=3D"">[email protected]</a><br style=3D"caret-color: rgb(0, =
0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: normal; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none;" class=3D""><a =
href=3D"https://mail.python.org/mailman/listinfo/pythonmac-sig" =
style=3D"font-family: Helvetica; font-size: 12px; 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;" =
class=3D"">https://mail.python.org/mailman/listinfo/pythonmac-sig</a><br =
style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: =
12px; font-style: normal; font-variant-caps: normal; font-weight: =
normal; letter-spacing: normal; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; text-decoration: none;" class=3D""><span =
style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: =
12px; font-style: normal; font-variant-caps: normal; font-weight: =
normal; letter-spacing: normal; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; text-decoration: none; float: none; =
display: inline !important;" class=3D"">unsubscribe:<span =
class=3D"Apple-converted-space">&nbsp;</span></span><a =
href=3D"https://mail.python.org/mailman/options/Pythonmac-SIG" =
style=3D"font-family: Helvetica; font-size: 12px; 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;" =
class=3D"">https://mail.python.org/mailman/options/Pythonmac-SIG</a></div>=
</blockquote></div><br class=3D""><div class=3D"">
<div dir=3D"auto" style=3D"word-wrap: break-word; -webkit-nbsp-mode: =
space; line-break: after-white-space;" class=3D""><div =
style=3D"caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: =
Helvetica; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: normal; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none;">=E2=80=94</div><div style=3D"caret-color: rgb(0, 0, 0); color: =
rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: =
normal; font-variant-caps: normal; font-weight: normal; letter-spacing: =
normal; text-align: start; text-indent: 0px; text-transform: none; =
white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none;"><br class=3D""></div><div style=3D"caret-color: =
rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Helvetica; font-size: =
12px; font-style: normal; font-variant-caps: normal; font-weight: =
normal; letter-spacing: normal; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; text-decoration: none;">Twitter / =
micro.blog: @ronaldoussoren</div><div style=3D"caret-color: rgb(0, 0, =
0); color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; =
font-style: normal; font-variant-caps: normal; font-weight: normal; =
letter-spacing: normal; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; text-decoration: none;">Blog: <a =
href=3D"https://blog.ronaldoussoren.net/" =
class=3D"">https://blog.ronaldoussoren.net/</a></div></div>
</div>
<br class=3D""></body></html>=

--Apple-Mail=_EF297C2D-3927-44A7-BB16-39F72129A9E3--

--===============0257891887314056628==
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

--===============0257891887314056628==--