[HN Gopher] Show HN: PyApp - runtime installer for Python applic... ___________________________________________________________________ Show HN: PyApp - runtime installer for Python applications Author : ofek Score : 63 points Date : 2023-12-13 16:17 UTC (6 hours ago) (HTM) web link (github.com) (TXT) w3m dump (github.com) | dkroy wrote: | This looks really useful. I would love to see some more end-to- | end examples though it's nice to see the animated one right away | in the readme. | anze3db wrote: | There are some configuration examples the docs[0] but since the | project is still young there is probably room for improvements. | Any particular that you'd like to see there? | | [0] https://ofek.dev/pyapp/latest/examples/ | notatallshaw wrote: | An example of running this on the command line that isn't a | GIF. | pabe wrote: | How does it differentiate from PyInstaller? | toyg wrote: | ... or py2exe, cxFreeze... | globular-toast wrote: | I wondered the same, then checked the source. The difference is | this one is made with Rust. | ofek wrote: | The main difference is it does no build sorcery. In the end, | your code is running on a real installation on disk. Therefore, | there is no chance for extension modules to fail. | seanthemon wrote: | Does it potentially solve the problem of anti viruses false- | flagging the runtime? Pyinstaller was giving me huge | headaches with this | pantsforbirds wrote: | Are there any examples of PyApp using libraries that wrap other | languages (Numpy, SpaCy, etc.)? In my experience, it has been | extremely difficult to ship data/ml heavy applications built with | Python as a binary. | ofek wrote: | I think this is the most common pattern where you wish to | execute a script based on a requirements file: | https://ofek.dev/pyapp/latest/examples/#dependency-file-with... | isoprophlex wrote: | Holy shit! So looking at the flowchart elsewhere in the docs, | this means the executable produced by pyapp will ensure the | requirements file is processed before executing the actual | module code? | | This is magic. | ofek wrote: | Yes it will that is exactly correct! That particular | example actually was after I was reading how to set up | Stable Diffusion and other AI stack stuff. | isoprophlex wrote: | I love this. This is exactly the idea the python | ecosystem needs to unfuck it's packaging/distribution | hell. I will start using this at work to try and solve | the "how the hell do I distribute the spaghetti these | devs produce in a sensible way" problem (we bundle | dockerfiles atm and it's less than ideal) | | Will let you know if I have any avenues for potential | improvement, etc. | anze3db wrote: | This looks really awesome! I'll try it out on some of my projects | that I never tried to share outside of the Python community | because setting up Python and/or pipx always felt too much of a | hassle for end users. | | Leave it to ofek to tackle one of the toughest problems in | Python! | globular-toast wrote: | You definitely shouldn't require users to install pipx and | double definitely not Python. Pipx is good for dev tooling like | tox et al, though. | | Did you ever try pyinstaller? | ktm5j wrote: | I've had some success with pyinstaller but recently have been | getting inconsistent results with an application I've written | that uses pyside6. It was working for a while but all of a | sudden the pyinstaller exe is giving an error that doesn't | happen when I run the same code using python. | | Happened right before I had to go to the hospital (where I | currently am) so I haven't had a chance to dig into it. But | if this works reliably I'd be happy to switch. | ofek wrote: | Can you please let me know how your experience is? Feel | free to even open an issue on the repo! | qubidt wrote: | How does this compare to shiv? https://github.com/linkedin/shiv | potatochup wrote: | Shiv doesn't pack a python interpreter, it looks like this does | ofek wrote: | You can pack a Python interpreter but by default it downloads | it (if not already cached) | pacifika wrote: | Hopefully it's a bit faster than ptinstallers first run | experience. That was the main reason I didn't use it. | ofek wrote: | Can you please let me know how your experience goes after | trying this? | pacifika wrote: | Yup | delijati wrote: | will go on my "to try" list where i already have cosmopolitan | [2]. my last setup (windows) was shiv + wine + nsis (used that as | pyinstaller had some issues)[2] | | [1] | https://github.com/jart/cosmopolitan/issues/141#issuecomment... | [2] https://github.com/delijati/docker-shiv#add-python- | interpret... | ofek wrote: | Please let me know how it goes! ___________________________________________________________________ (page generated 2023-12-13 23:00 UTC)