coconut
coconut copied to clipboard
Coconut is incompatible with the zipapp module
Part of coconut's current header contains a check for a __init__.py
file in the executed python file's directory. That check uses os.listdir
which cannot operate within a zippapp. It is a known issue for zippapps to not be able to read files and directories like you could if you simply execute a python script, or a directory (using __main__.py
). Tools like https://github.com/linkedin/shiv seem to circumvent this by extracting the zipapp before execution.
I'm not sure this is easily fixable, but since I just racked my brain for an hour wondering why this suddenly stopped working compared to older coconut versions, maybe a warning could be added to the docs or faq? :)
I think that you should be able to make this work if you compile everything with --stand-alone
.
After a few quick tests, this indeed seems to be working, at the cost of tripling the resulting build's size. But I think can live with that for now :)