cloudmatrix / esky

an auto-update framework for frozen python apps
BSD 3-Clause "New" or "Revised" License
363 stars 74 forks source link

Fix bootstrap on python 3 for py2app #140

Closed tyroneabdy closed 8 years ago

tyroneabdy commented 8 years ago

This is based off of the issue on github issue #104.

Which roughly follows as.

I've run this on python3.4 on osx 10.9.4. I haven't tested any other version of python or osx.

timeyyy commented 8 years ago

@JPFrancoia do you still have access to a mac? Do you want to give this a spin.

@tyroneabdy thanks alot for the pr, if at all possible would you be able to test it on python 3.5? I'm happy to merge this even if it only works on 3.4 though.

tyroneabdy commented 8 years ago

@timeyyy So I just tested it on python3.5 using stage1 of the tutorial. With it running on 3.5 it doesn't crash like it does with the current HEAD from master. So without investigating it too deeply aside from running it with master and running it with my patch it does appear to be working. Though it does fail in the same fashion it used to on python3.4 for our main application. I can't tell you if our main application runs on 3.5 or not, as there are a number of other dependencies that don't support 3.5 at this time.

timeyyy commented 8 years ago

@tyroneabdy awesome :+1:

JPFrancoia commented 8 years ago

I will try it as soon as I can, right now I don't have access to a Mac. Does this PR avoid all the copy/paste mentionned in #104 ?

timeyyy commented 8 years ago

It extracts the .zip to a temp dir and makes a new one with the required libs. Then sits it in the bootstrap dir. Do you know when you might be able to test it ? If it's not in the near future i'll just go ahead and merge this.

@tyroneabdy I have converted 93% of codebase to support python 2 and 3 without conversion. If you would like to help with the mac part of the code i can point you in the right direction. The main benifet is that all the tests will run for python 3 as well as python 2.

tyroneabdy commented 8 years ago

I'll be looking at Python 3.4 on Mac OSX and Windows in the coming weeks with Esky and our application. We might not use everything that everyone uses, but I am more than happy to work on something where needed.

JPFrancoia commented 8 years ago

@timeyyy Sadly I don't know when I'll get my hands on a Mac. But you should merge it anyway, for now Esky doesn't work at all for OSX. I use a post-esky script to patch the bugs.

Among other things, here is what I do to make my app runnable (complete file: https://github.com/chembrows/ChemBrows/blob/master/deploy/deploy.py):

    # Get the path where the changes will be made
    path_fixes = 'dist/{}/{}.app/Contents/'.format(filename, app_name)

    # To fix issue #104 of Esky. Copy some files stored in deploy. It should be
    # temporary, and it's not optimized yet (not all the modules in python35.zip are
    # required)
    copyfile('deploy/OSX_extras/zlib.so', path_fixes + 'Resources/lib/python3.5/lib-dynload/zlib.so')
    copyfile('deploy/OSX_extras/python35.zip', path_fixes + 'Resources/lib/python35.zip')

@tyroneabdy: does you app use PyQt ?

tyroneabdy commented 8 years ago

@JPFrancoia We use PySide, not PyQt, though as far as I am aware qt4.8 isn't much different on either of those.

@timeyyy I've done those changes.

tyroneabdy commented 8 years ago

@timeyyy I did those comment changes, let me know if that makes sense.