jamesabel / osnap Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
I created a venv
on Windows and tried to run
python -m osnap.osnapy
But osnap/utils.py requires requests
.
Update osnapy to use pkg-config to locate openssl, or perhaps to hard-code brew --cellar [email protected] .
(There are lots of reasons that /usr/local might be a bad choice. @glyph)
With the current code, appdirs should be added to setup.py. But it would be better to just use balsa.
I'm running windows 10 on a VM on a mac.
It's 32-bit on an x86-based processor.
I ran
python -m osnap.osnapy
using python 3.5.2 I get the following:
Z:\temp>python -m osnap.osnapy
get https://www.python.org/ftp/python/3.5.2/python-3.5.2-embed-amd64.zip to cache\python-3.5.2-embed-amd64.zip
Traceback (most recent call last):
File "C:\Users\Eli Ribble\AppData\Local\Programs\Python\Python35-32\lib\runpy.py", line 184, in _run_module_as_main
"main", mod_spec)
File "C:\Users\Eli Ribble\AppData\Local\Programs\Python\Python35-32\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\Eli Ribble\AppData\Local\Programs\Python\Python35-32\lib\site-packages\osnap\osnapy.py", line 54, in
main()
File "C:\Users\Eli Ribble\AppData\Local\Programs\Python\Python35-32\lib\site-packages\osnap\osnapy.py", line 51, in main
make_osnapy(args.python_version, args.application, args.clear, args.verbose, args.egenix_pyrun, args.force_uninstall)
File "C:\Users\Eli Ribble\AppData\Local\Programs\Python\Python35-32\lib\site-packages\osnap\osnapy.py", line 30, in make_osnapy
osnapy.create_python()
File "C:\Users\Eli Ribble\AppData\Local\Programs\Python\Python35-32\lib\site-packages\osnap\osnapy_win.py", line 58, in create_python
subprocess.check_call(cmd)
File "C:\Users\Eli Ribble\AppData\Local\Programs\Python\Python35-32\lib\subprocess.py", line 576, in check_call
retcode = call(*popenargs, **kwargs)
File "C:\Users\Eli Ribble\AppData\Local\Programs\Python\Python35-32\lib\subprocess.py", line 557, in call
with Popen(*popenargs, **kwargs) as p:
File "C:\Users\Eli Ribble\AppData\Local\Programs\Python\Python35-32\lib\subprocess.py", line 947, in init
restore_signals, start_new_session)
File "C:\Users\Eli Ribble\AppData\Local\Programs\Python\Python35-32\lib\subprocess.py", line 1224, in _execute_child
startupinfo)
OSError: [WinError 216] This version of %1 is not compatible with the version of Windows you're running. Check your computer's system information and then contact the software publisher
Z:\temp>
For very simple programs there may be no external requirements. In that case OSNAP still requires that requirements.txt be present. If the file is empty, which it should be, we get an error from pip about an empty file
I accidentally ran the installer builder when my script was called 'goo.py' rather than 'main.py'. It still produced an exe and an installer. I had to dig through the output to notice that it emitted an error log indicating I didn't have main.py. it'd probably be best to fail the whole process at that point so users don't waste time as I did looking at the produced output that will never work
Probably the best comparison of Python freezers is available here, on The Hitchiker's Guide to Python. In the pursuit of better osnap publicity, I recommend submitting a PR to add osnap (and maybe also a column indicating whether each project is maintained. bbfreeze, for instance, is not :) )
I'm slowly working my way through getting this project working and hitting some stuff that's a little frustrating. OSNAP does a bunch of processing before getting around to a cryptic stack trace about the failure rather than checking upfront if everything it needs is there. This includes:
a directory named the same as my application name that it wants to copy. In my case my sample application is called 'goo' and it wants a folder named 'goo'. It was happy as soon as I added one with an empty init.py in it
a LICENSE file. Also can be empty, I think
an icon file, again, based on the name of the application. Such as 'goo.ico'
NSIS installed at C:\Program Files (x86)\NSIS\makensis.exe
there's no summary in the tagline on the project :)
I have no need for an NSIS installer when I build because I use my own WiX installer. I'd like to avoid the requirement of having NSIS installed on my build machine. Let's create a commandline switch to disable the NSIS installer. This will maintain the current default behavior but just optionally disable this step of the packaging process
Here 2e4a7f7#diff-e272fd5500f2ed699f985d24b5403b06R10 you say that you can't install pip
when using the embeddable zip file version of Python 3.6.0.
How are you installing pip?
I tried both python.exe -m ensurepip
and python.exe -m pip install pip
and neither of them work in Python 3.6.0 or Python 3.5.2
Perhaps I missed it in the documentation but I didn't see anything about installing whatever packages build is. On OSX El Capitan I get the following exception.
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '/usr/local/bin/packagesbuild pathlt.pkgproj' returned non-zero exit status 127
After a little bit of googling around it looks like this is or was part of xcode. I have xcode installed but this doesn't seem to be on my system. The docs should probably call this out explicitly with some installation instructions similar to NSIS
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.
I am trying to package an app, but I keep getting an error about version
PycharmProjects/qt-projects/PyQt-projects/SR/osnap_setup.py", line 9, in make_installer
[APPLICATION_NAME], main_app.version, verbose=verbose)
AttributeError: module 'main_app' has no attribute 'version'
Currently OSNAP uses launchwin as the underlying bootstrapping process for executables it produces. launchwin is checked in to git as a 64-bit binary. In many situations it's nice to build a 32-bit binary on a 64-bit machine so that the binary will work correctly on a broader base of windows installations. OSNAP should support an option to build a 32-bit binary by force no matter what the system architecture is. This will mean maintaining two different versions of launchwin for bootstrapping in the repository
Hey I'm trying to build an installer for this code.
https://github.com/Siecje/qml-testing/tree/osnap
Full steps are in the README.md of the repo
(osnap) C:\Users\cody\Desktop\qml-testing>python build.py
clearing and making dist (C:\Users\cody\Desktop\qml-testing\dist)
done making dist (C:\Users\cody\Desktop\qml-testing\dist)
unzipping C:\Users\cody\Desktop\osnap\Scripts\..\osnap\launchwin.zip to dist
copying app to dist\osnapp\app
copying osnapy to dist\osnapp\osnapy
copying main.py to dist\osnapp
moving dist\launch.exe to dist\app.exe
writing app.nsis
['c:\\Program Files (x86)\\NSIS\\makensis', 'app.nsis']
Processing config: c:\Program Files (x86)\NSIS\nsisconf.nsh
Processing script file: "app.nsis" (ACP)
warning: LicenseData: empty license file "LICENSE"
(app.nsis:18)
warning: unknown variable/constant "{INSTALLSIZE}" detected, ignoring (app.nsis:76)
Processed 1 file, writing output (x86-ansi):
Output: "C:\Users\cody\Desktop\qml-testing\installers\app_installer.exe"
Can't open output file
Error - aborting creation process
Traceback (most recent call last):
File "build.py", line 12, in <module>
make_installer(True)
File "build.py", line 9, in make_installer
[APPLICATION_NAME], '1.0.0', verbose=verbose)
File "C:\Users\cody\Desktop\osnap\lib\site-packages\osnap\installer.py", line 148, in make_installer
subprocess.check_call(pkgproj_command)
File "C:\Users\cody\Anaconda3\lib\subprocess.py", line 581, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['c:\\Program Files (x86)\\NSIS\\makensis', 'app.nsis']' returned non-zero exit status 1
https://github.com/jamesabel/osnap/blob/master/osnap/installer.py#L26
Explicitly looks for main.py in the current working dir. I assume this is used as the main entry point but not all packages uses main.py as the entry point. If this is an actual requirement it should be documented.
The code and build steps can be found here https://github.com/Siecje/qml-testing/tree/osnap
When I run build.py I get the following error.
(osnap) C:\Users\cody\qml-testing>python build.py
removing dist (C:\Users\cody\qml-testing\dist)
making dist (C:\Users\cody\qml-testing\dist)
removing installers (C:\Users\cody\qml-testing\installers)
making installers (C:\Users\cody\qml-testing\installers)
unzipping c:\users\cody\osnap\lib\site-packages\osnap\launchwin.zip to dist
copying main.py to dist\osnapp
moving dist\launch.exe to dist\app.exe
Traceback (most recent call last):
File "build.py", line 12, in <module>
make_installer(True)
File "build.py", line 9, in make_installer
[APPLICATION_NAME], '1.0.0', verbose=verbose)
File "C:\Users\cody\osnap\lib\site-packages\osnap\installer.py", line 21, in make_installer
installer.make_installer()
File "C:\Users\cody\osnap\lib\site-packages\osnap\installer_win.py", line 58, in make_installer
nsis_defines['VERSIONMINOR'] = v[1]
IndexError: list index out of range
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.