Closed johannesloibl closed 2 months ago
@johannesloibl I assume you are on Windows, correct?
I am not sure on any of the hatch
configurations since I never used this, but I am very surprised you say that the executable (assuming you mean the PyApp
created binary) always executes with pythonw.exe
. This should only be the case if PYAPP_IS_GUI
was set to 1
when packaging and is in fact the case on my system. I could see how it could always uses python.exe
...
Anyway, I'll have a look at the hatch
way of packaging a binary, sounds really interesting.
@trappitsch Yes i'm on Windows.
Right now i'm not even setting PYAPP_IS_GUI.
I'm only setting PYAPP_DISTRIBUTION_EMBED=false,PYAPP_FULL_ISOLATION=true and PYAPP_PIP_EXTRA_ARGS before building the executable using hatch build -t app
.
The resulting executable is executed using pythonw.exe
I can't reproduce and it appears impossible for that code path to be hit without the variable being enabled.
I'll check again later. I know the code path and I'm equally puzzled :D
Ok so i checked again and now i also cannot reproduce it. Maybe i f***ed up my environment variables when trying around and did not notice. Sorry for the confusion. PYAPP_IS_GUI=1 --> pythonw.exe, PYAPP_IS_GUI=0 --> python.exe.
For the other topic i'll create a feature request in the Hatch repo, to support more PyApp options in Hatch itself 👍🏻
Hey Ofek,
really great job you're doing here! I'd really like to get PyApp running and got first promising results already.
I'm trying to bundle an app that both has
scripts
andgui-scripts
defined. Unfortunately PyApp does not support selecting the GUI entrypoint in the binary target optionscripts
.I can somehow workaround it and define my GUI entrypoints under
[project.scripts]
, since luckily even like this no console window is shown, but that's no how it's supposed to be.I tried setting the script option to an empty list and define the execution mode by setting one of
PYAPP_EXEC_*
, but this is not working, since "empty list" is considered as "default to all entries of[project.scripts]
". So afaik there is currently no chance of defining a custom execution mode, or is it??I just noticed it does not matter if i set
PYAPP_IS_GUI
to0
or1
, the executable is always starting apythonw.exe
, contrary to your documentation here.Just as a reference, this is part of my config:
Then i'm building with
hatch build -t binary
.