News for hackers. Stuff that matters.
Re:Pyship: Static Python for desktop apps by p4wnc6 on Saturday March 19, 2016 @10:15PM (#11321469)
Another route is to compile via Cython with the interpreter embedded.

https://github.com/cython/cython/tree/master/Demos/embed

You could take your existing Python code and simply change the .py extension to .pyx and compile with the `--embed` option.

Of course, it requires compile dependence on Cython.

Re:Pyship: Static Python for desktop apps by Slippery_John on Saturday March 19, 2016 @08:59PM (#11321267)
> Currently only supports OSX

Not sure how this is particularly useful then, since OSX ships with python 2.7. Something like this could be useful on Windows / Linux since they don't necessarily have a python installed, or if it was bundling 3.5.

Re:Pyship: Static Python for desktop apps by burrows on Saturday March 19, 2016 @09:05PM (#11321289)
Have you tried shipping a python application to end users while relying on the OS X system python? In my experience, this is an extremely painful process.

You would either need to do all of your development/testing with the system python or ensure that you're development environment is compatible with the system python (including stuff like distutils.util.get_platform(), https://github.com/MacPython/wiki/wiki/Spinning-wheels).

What do you do when Apple doesn't update their python with some patch you want?

Re:Pyship: Static Python for desktop apps by makecheck on Saturday March 19, 2016 @09:51PM (#11321411)
Yes, I do this for my project.

Although, I do not attempt to install any libraries, I keep everything in the application bundle and set environment variables as needed.

It is limiting in the sense that I must use the Python version that Apple does but at the same time, the shipping executable is downright tiny compared to most Mac OS X applications.

Re:Pyship: Static Python for desktop apps by burrows on Saturday March 19, 2016 @10:01PM (#11321430)
Are you modifying sys.path() to load the dependencies that are shipped with the app; or some other technique?
Re:Pyship: Static Python for desktop apps by makecheck on Sunday March 20, 2016 @02:07PM (#11323915)
I use the location of the script to find the absolute path to the bundle (MacOS folder), from which I can work backwards using ".." to find other things like bundled libraries.

In my case some of the libraries are also compiled so I have a starter script that sets DYLD_LIBRARY_PATH, PYTHONPATH, etc. and runs a 2nd script that can then successfully import whatever is required.

Re:Pyship: Static Python for desktop apps by thln666 on Sunday March 20, 2016 @12:26AM (#11321801)
So...like pex but worse?

https://github.com/pantsbuild/pex

Re:Pyship: Static Python for desktop apps by rkeene2 on Saturday March 19, 2016 @10:23PM (#11321491)
I wonder if Python can't support something like starkits/starpacks from the Tcl world ?

There's a somewhat similar Perl implementation but it extracts files to the real filesystem and executes them rather than just reading from a VFS.

Re:Pyship: Static Python for desktop apps by jofer on Saturday March 19, 2016 @10:44PM (#11321554)
That's basically what pyinstaller is. It's not quite the same (extracts files to the temp directory), but it's the same general idea.

A lot of Python applications on Windows are distributed this way.

Re:Pyship: Static Python for desktop apps by akkartik on Saturday March 19, 2016 @09:30PM (#11321359)
I love the command in the readme for computing dependencies of arbitrary projects.
Re:Pyship: Static Python for desktop apps by mwcampbell on Saturday March 19, 2016 @09:07PM (#11321300)
How is this different from py2app?
Re:Pyship: Static Python for desktop apps by burrows on Saturday March 19, 2016 @09:16PM (#11321325)
I initially tried using py2app/py2exe/cx_Freeze, but stuff kept crashing. They're trying to do something considerably more complicated than my 90 LOC bash script; namely trying to bundle your application, it's dependencies and the python interpreter into one package.

This bash script just gives you a python interpreter that should run on any system. From there, your install script can setup a virtualenv, grab dependencies and do whatever else.

Re:Pyship: Static Python for desktop apps by w_t_payne on Sunday March 20, 2016 @06:27AM (#11322438)
How is this different from eGenix PyRun?
Re:Pyship: Static Python for desktop apps by topkekz on Sunday March 20, 2016 @05:41AM (#11322371)
Nuitka compiles python into a native executable

http://nuitka.net/pages/overview.html