Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What makes OSNAP different from py2exe? #10

Open
EliRibble opened this issue Nov 3, 2016 · 8 comments
Open

What makes OSNAP different from py2exe? #10

EliRibble opened this issue Nov 3, 2016 · 8 comments

Comments

@EliRibble
Copy link
Contributor

While I was working on the project I noticed that OSNAP uses py2exe under the covers. I don't think that's really a problem, but my initial review of the technology led me to think that OSNAP was a simpler replacement for py2exe using the new embeddable python shipped with recent Python 3. Now I'm not so sure. What are the advantages of the project over using py2exe directly?

You can consider this issue a request for documentation, but mostly I just wanted to talk to you about it since I'm in the process of evaluating exactly which way our company will go with freezing technology for our next project and I want to make an informed decision.

@jamesabel
Copy link
Owner

I put this together over the last few days as a part of answering that question : https://github.com/jamesabel/spafit . Scroll to the bottom to see a comparison table. When I started osnap actually all were failing. If all you need is Windows pynsist is a good choice as it is fairly mature. I'd be happy to discuss the tradeoffs further if you like.

@EliRibble
Copy link
Contributor Author

The table is pretty good, thanks. So I suppose you'd summarize it that osnap is designed to address failings for people using the latest python (3.4+). When I attempted to use osnap on windows with python 3.5 I hit errors in py2exe. My understanding is that py2exe doesn't support python 3.5 on windows due to changes in the way that python 3.5 is compiled for windows compared to previous versions of python 3. Did your tests show OSNAP working on windows with python 3.5 in spite of the dependency on py2exe?

@jamesabel
Copy link
Owner

py2exe (and py2app for Mac) is only used to create the launcher. The launchers are pre-built in osnap and are provided as a binary executable. So there really isn't a regular package dependency on py2exe - it's just that py2exe is used to make the launchers. Actually, I used Python 3.4 to make the launcher on Windows. I also just checked in the make_venv.bat for the launcher to show what I did. The launchers could have been coded in the native environments for each OS, but it was just easier to do it this way.

@EliRibble
Copy link
Contributor Author

So the issue I hit has to do with the fact that I was building the launcher from source (since I was in the middle of making a pull request) and I was using python 3.5 as my system python. I could have used python 3.4 to build the launcher which would have used py2exe and would have worked. That launcher then could have been used with osnap in python 3.5 to build my application and it would have worked just fine. Do I have that correct?

@jamesabel
Copy link
Owner

Actually, you shouldn't have had to build the launcher at all. It's in the package from PyPI and also already here: https://github.com/jamesabel/osnap/blob/master/osnap/launchwin.zip .

@jamesabel
Copy link
Owner

Or are you saying that py2exe emits a 64 bit only exe? That's possible - I never looked into it. In that case I need to tell it to make a 32 bit one so that it works on both 32 and 64 bit.

@EliRibble
Copy link
Contributor Author

I believe I was doing this work on the 64-bit machine at the time. I was attempting to test my pull request on both platforms and at some point I got a stack trace about not being able to find launchwin.zip. I think. Sorry, this was yesterday and I was doing several things at once. Since you've merged my PR I can re-test on both platforms tomorrow and let you know if there was something wrong. Your explanation has helped a great deal with understanding the architecture, thank you.

@jamesabel
Copy link
Owner

BTW here are slides from a lighting talk I did: https://github.com/jamesabel/osnap/blob/master/docs/presentations/sf_python_sep_2016_james_abel_osnap.pdf . Since it was a lightening talk they don't stand that well on their own, so take from it what you will. I do need to add a real arch diagram to the docs - thanks for reminding me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants