Announcing the PyOxy Python Runner, a single file (C)Python distribution
gregoryszorc.com
gregoryszorc.com
Very cool, even if it standard library only. I am frequently annoyed at the hoops I jump through to distribute Python onto Windows machines.
Is the main idea here to be able to provide some of the benefits of a static binary (like a Go compiled binary)? Namely, you can keep this pyoxy binary with your project and then all of your custom code/dependencies/etc... are kept together in one single folder without relying on the system Python?
If so... I like it. Then the next step would be merging this binary with your code (plus dependencies) in one file, or maybe pyoxy plus an egg file? (or wheel? I can't keep track anymore). Seems like it would work for pure python dependencies pretty well, but would still have issues with dependencies that require compiling?
If I want to deploy a Python program on a Windows machine, my current workflow is roughly:
- Install Python system wide
- Ensure there is Python venv + pip + (QoL) virtualenvwrapper
- Create virtual environment per program
- Load up my code
Not horrible, but if I could package Python + extra code into a zip file, I could just create foobar-v20220512.zip send that to anybody, and have them unzip the entire program into the same directory every time. Then they could do it without admin privileges and with the most minimal of user training. Easy versioning to boot.PyInstaller, Nukita, etc probably already make this possible, but I have never taken the plunge to explore them. I have assumed there are some rough edge gotchas (C libraries) that would make me regret the decision.
https://shiv.readthedocs.io/en/latest/
EDIT: oh I just read through the PyOxidizer docs, seems like they already do have this capability as a goal, PyOxy is actually extracting out the shippable one-exec python out.
It's called Python Packed Resources https://pyoxidizer.readthedocs.io/en/stable/oxidized_importe...
Looks like a very slick set of tools.
It might be nice if easy-to-use distributions like conda adopt this and give us a 1GB all-in-one-binary to run whatever I want. A large binary is fine as long as it is mmap-ed and doesn't waste memory.