Re: [Pythonmac-SIG] py2app failure with framework build of 2.7

2013-04-05 Thread Ronald Oussoren

On 4 Apr, 2013, at 17:01, Nat Echols nathaniel.ech...@gmail.com wrote:

 On Thu, Apr 4, 2013 at 5:46 AM, Ronald Oussoren ronaldousso...@mac.com 
 wrote:
 Replying to my own post: after sending this, I read the section in the
 documentation about alias mode.  This seems to work fine, and
 produces an app that is 50KB instead of nearly 9MB.  Since I'm running
 this script as part of a complicated build and installation process,
 and the path to the interpreter and all modules is frozen by the time
 I need to make my app, it would seem that alias mode should work fine
 for actually *deploying* my software.  Is there any drawback to doing
 this?
 
 An alias mode build contains symlinks to the python files in your 
 application, and is therefore not a useful way to deploy.
 
 It's still not totally clear to me if this is really a drawback in my
 case.  The software distribution in question is a huge (~2GB) mess
 originally written for Unix systems, and the installation process is
 somewhat... inelegant.  Users have a choice of a) running a shell
 script which installs to a destination of their choice, and runs the
 py2app script at the end (after the new location is made permanent),
 or b) running a .pkg which installs in /Applications, which includes
 the pre-built .app file.  In the first case, I'm pretty certain the
 symlinks won't be a problem.  I'm not sure about the second - will
 packagemaker screw these up?  The original paths will be accurate but
 I have to move stuff around as part of the packaging process, and I
 have no idea what happens internally.

Packagemaker should't be problem here, although the build procedure might
be problematic: IIRC the app bundle contains symlinks where the target
is an absolute path, and therefore you need to create the app from
sources that are already in the final location (e.g. somewhere below 
/Applications).

It might be better to create a --semi-standalone, --use-sitepackages build, and
--exclude most of the code. Assuming you also install a shared library build
(either --enable-shared or --enable-framework) of Python in /Applications that 
should be fairly easy to get to work (you have to update the application's 
Info.plist 
to force it to look for Python in the right location, but that's the hardest 
part).

The primary reason I dislike using an alias build for deployment is that alias
builds are meant to be a way to speed up development and I might accidently 
break
the deployment usecase when I find ways to make alias builds better for
the application development use case.

Ronald

 
 thanks,
 Nat

___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG


Re: [Pythonmac-SIG] py2app failure with framework build of 2.7

2013-04-05 Thread Nat Echols
On Thu, Apr 4, 2013 at 11:28 PM, Ronald Oussoren ronaldousso...@mac.com wrote:
 Packagemaker should't be problem here, although the build procedure might
 be problematic: IIRC the app bundle contains symlinks where the target
 is an absolute path, and therefore you need to create the app from
 sources that are already in the final location (e.g. somewhere below 
 /Applications).

In fact this does appear to be problematic in our build system - the
resulting .app contains references to the directory where I built the
package.  It appears, however, that the self-contained app builds okay
in this context; the only place where the apparent bug shows up is on
my laptop, where everything was installed more-or-less manually.  I'm
a little spooked by this, since it makes me suspect that my script
isn't as general-purpose as would be ideal, but at least this should
allow me to build working installers for distribution.

-Nat
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG


Re: [Pythonmac-SIG] py2app failure with framework build of 2.7

2013-04-04 Thread Ronald Oussoren

On 4 Apr, 2013, at 1:12, Nat Echols nathaniel.ech...@gmail.com wrote:

 Replying to my own post: after sending this, I read the section in the
 documentation about alias mode.  This seems to work fine, and
 produces an app that is 50KB instead of nearly 9MB.  Since I'm running
 this script as part of a complicated build and installation process,
 and the path to the interpreter and all modules is frozen by the time
 I need to make my app, it would seem that alias mode should work fine
 for actually *deploying* my software.  Is there any drawback to doing
 this?

An alias mode build contains symlinks to the python files in your application, 
and is therefore not a useful way to deploy.

I don't know yet why building the application fails, I'll try to reproduce the 
issue in the weekend.

Ronald

 
 thanks,
 Nat
 
 On Wed, Apr 3, 2013 at 3:45 PM, Nat Echols nathaniel.ech...@gmail.com wrote:
 I'm trying to make a simple iconified Python launcher for a shell
 script, and something I'm doing isn't working, despite having used
 py2app successfully before.  The target Python program
 (my_program_wrapper.py) consists of this:
 
 import os
 import sys
 os.environ[PYTHONPATH] = 
 os.spawnv(os.P_NOWAIT, /Users/nat/bin/my_program, [my_program])
 
 I then run this:
 
 /path/to/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
 Python.framework/Versions/Current/lib/python2.7/site-packages/py2app-0.7.3-py2.7.egg/py2app/script_py2applet.py
 --make-setup my_program_wrapper.py
 
 which is fine, and gives me this for setup.py:
 
 
 from setuptools import setup
 
 APP = ['my_program_wrapper.py']
 DATA_FILES = []
 OPTIONS = {'argv_emulation': False,
 'iconfile': '/Users/nat/my_program.icns'}
 
 setup(
app=APP,
data_files=DATA_FILES,
options={'py2app': OPTIONS},
setup_requires=['py2app'],
 )
 
 
 Then I run this:
 
 /path/to/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
 setup.py py2app
 
 and that runs for a few seconds, prints a bunch of output, then crashes here:
 
 creating 
 /Users/nat/Desktop/py2app_tmp/py2app_tmp/dist/phenix.app/Contents/Frameworks/Python.framework
 creating 
 /Users/nat/Desktop/py2app_tmp/py2app_tmp/dist/phenix.app/Contents/Frameworks/Python.framework/Versions
 creating 
 /Users/nat/Desktop/py2app_tmp/py2app_tmp/dist/phenix.app/Contents/Frameworks/Python.framework/Versions/Current
 creating 
 /Users/nat/Desktop/py2app_tmp/py2app_tmp/dist/phenix.app/Contents/Frameworks/Python.framework/Versions/Current/Resources
 error: File exists
 
 It works fine if I use /usr/bin/python instead, but that isn't an
 option because this needs to be able to run on OS 10.4, which has
 Python 2.3 (which chokes on an import in py2app).  Am I doing
 something wrong, or is this a bug?
 
 thanks,
 Nat
 ___
 Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
 http://mail.python.org/mailman/listinfo/pythonmac-sig
 unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG

___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG


Re: [Pythonmac-SIG] py2app failure with framework build of 2.7

2013-04-04 Thread Nat Echols
On Thu, Apr 4, 2013 at 5:46 AM, Ronald Oussoren ronaldousso...@mac.com wrote:
 Replying to my own post: after sending this, I read the section in the
 documentation about alias mode.  This seems to work fine, and
 produces an app that is 50KB instead of nearly 9MB.  Since I'm running
 this script as part of a complicated build and installation process,
 and the path to the interpreter and all modules is frozen by the time
 I need to make my app, it would seem that alias mode should work fine
 for actually *deploying* my software.  Is there any drawback to doing
 this?

 An alias mode build contains symlinks to the python files in your 
 application, and is therefore not a useful way to deploy.

It's still not totally clear to me if this is really a drawback in my
case.  The software distribution in question is a huge (~2GB) mess
originally written for Unix systems, and the installation process is
somewhat... inelegant.  Users have a choice of a) running a shell
script which installs to a destination of their choice, and runs the
py2app script at the end (after the new location is made permanent),
or b) running a .pkg which installs in /Applications, which includes
the pre-built .app file.  In the first case, I'm pretty certain the
symlinks won't be a problem.  I'm not sure about the second - will
packagemaker screw these up?  The original paths will be accurate but
I have to move stuff around as part of the packaging process, and I
have no idea what happens internally.

thanks,
Nat
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG


Re: [Pythonmac-SIG] py2app failure with framework build of 2.7

2013-04-04 Thread Chris Barker - NOAA Federal
On Thu, Apr 4, 2013 at 8:01 AM, Nat Echols nathaniel.ech...@gmail.com wrote:
 On Thu, Apr 4, 2013 at 5:46 AM, Ronald Oussoren ronaldousso...@mac.com 
 wrote:

 An alias mode build contains symlinks to the python files in your 
 application, and is therefore not a useful way to deploy.

 It's still not totally clear to me if this is really a drawback in my
 case.  The software distribution in question is a huge (~2GB) mess
 originally written for Unix systems, and the installation process is
 somewhat... inelegant.  Users have a choice of a) running a shell
 script which installs to a destination of their choice, and runs the
 py2app script at the end (after the new location is made permanent),

This should work well, and actually, issues with doing a proper
py2app bundle aside, may be the best way to do it. The point of Py2app
is to bundle up everything required into the app bundle, so that is it
one movable directory, hides teh pyton stuff from the user, and does
not rely on a particular pyton installation (i.e extra packages, etc).
But it sounds like in your case, you've got to install the whole pyton
environment anyway, along with all sorts of other stuff. So all you
need the app bundle for is to make a nice clickable icon. That's
exactly what I use alias mode for as well, though I've never tried to
give it to anyone else that way. Actually, I have -- I have set up a
setup.py script that works with py2app in alias mode (but not it
regular mode), then advised users to get the code installed, install
all the dependencies, then run py2app -A and build the alias really
what you are doing, except you are automating the rest of the install.

 or b) running a .pkg which installs in /Applications, which includes
 the pre-built .app file.  In the first case, I'm pretty certain the
 symlinks won't be a problem.  I'm not sure about the second - will
 packagemaker screw these up?  The original paths will be accurate but
 I have to move stuff around as part of the packaging process, and I
 have no idea what happens internally.

if it all gets put in the same places by the installation process, I
think it will work. But you never know until you try.

-Chris




-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/ORR(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

chris.bar...@noaa.gov
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG


[Pythonmac-SIG] py2app failure with framework build of 2.7

2013-04-03 Thread Nat Echols
I'm trying to make a simple iconified Python launcher for a shell
script, and something I'm doing isn't working, despite having used
py2app successfully before.  The target Python program
(my_program_wrapper.py) consists of this:

import os
import sys
os.environ[PYTHONPATH] = 
os.spawnv(os.P_NOWAIT, /Users/nat/bin/my_program, [my_program])

I then run this:

/path/to/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
Python.framework/Versions/Current/lib/python2.7/site-packages/py2app-0.7.3-py2.7.egg/py2app/script_py2applet.py
--make-setup my_program_wrapper.py

which is fine, and gives me this for setup.py:


from setuptools import setup

APP = ['my_program_wrapper.py']
DATA_FILES = []
OPTIONS = {'argv_emulation': False,
 'iconfile': '/Users/nat/my_program.icns'}

setup(
app=APP,
data_files=DATA_FILES,
options={'py2app': OPTIONS},
setup_requires=['py2app'],
)


Then I run this:

/path/to/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
setup.py py2app

and that runs for a few seconds, prints a bunch of output, then crashes here:

creating 
/Users/nat/Desktop/py2app_tmp/py2app_tmp/dist/phenix.app/Contents/Frameworks/Python.framework
creating 
/Users/nat/Desktop/py2app_tmp/py2app_tmp/dist/phenix.app/Contents/Frameworks/Python.framework/Versions
creating 
/Users/nat/Desktop/py2app_tmp/py2app_tmp/dist/phenix.app/Contents/Frameworks/Python.framework/Versions/Current
creating 
/Users/nat/Desktop/py2app_tmp/py2app_tmp/dist/phenix.app/Contents/Frameworks/Python.framework/Versions/Current/Resources
error: File exists

It works fine if I use /usr/bin/python instead, but that isn't an
option because this needs to be able to run on OS 10.4, which has
Python 2.3 (which chokes on an import in py2app).  Am I doing
something wrong, or is this a bug?

thanks,
Nat
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG


Re: [Pythonmac-SIG] py2app failure with framework build of 2.7

2013-04-03 Thread Nat Echols
Replying to my own post: after sending this, I read the section in the
documentation about alias mode.  This seems to work fine, and
produces an app that is 50KB instead of nearly 9MB.  Since I'm running
this script as part of a complicated build and installation process,
and the path to the interpreter and all modules is frozen by the time
I need to make my app, it would seem that alias mode should work fine
for actually *deploying* my software.  Is there any drawback to doing
this?

thanks,
Nat

On Wed, Apr 3, 2013 at 3:45 PM, Nat Echols nathaniel.ech...@gmail.com wrote:
 I'm trying to make a simple iconified Python launcher for a shell
 script, and something I'm doing isn't working, despite having used
 py2app successfully before.  The target Python program
 (my_program_wrapper.py) consists of this:

 import os
 import sys
 os.environ[PYTHONPATH] = 
 os.spawnv(os.P_NOWAIT, /Users/nat/bin/my_program, [my_program])

 I then run this:

 /path/to/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
 Python.framework/Versions/Current/lib/python2.7/site-packages/py2app-0.7.3-py2.7.egg/py2app/script_py2applet.py
 --make-setup my_program_wrapper.py

 which is fine, and gives me this for setup.py:

 
 from setuptools import setup

 APP = ['my_program_wrapper.py']
 DATA_FILES = []
 OPTIONS = {'argv_emulation': False,
  'iconfile': '/Users/nat/my_program.icns'}

 setup(
 app=APP,
 data_files=DATA_FILES,
 options={'py2app': OPTIONS},
 setup_requires=['py2app'],
 )
 

 Then I run this:

 /path/to/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
 setup.py py2app

 and that runs for a few seconds, prints a bunch of output, then crashes here:

 creating 
 /Users/nat/Desktop/py2app_tmp/py2app_tmp/dist/phenix.app/Contents/Frameworks/Python.framework
 creating 
 /Users/nat/Desktop/py2app_tmp/py2app_tmp/dist/phenix.app/Contents/Frameworks/Python.framework/Versions
 creating 
 /Users/nat/Desktop/py2app_tmp/py2app_tmp/dist/phenix.app/Contents/Frameworks/Python.framework/Versions/Current
 creating 
 /Users/nat/Desktop/py2app_tmp/py2app_tmp/dist/phenix.app/Contents/Frameworks/Python.framework/Versions/Current/Resources
 error: File exists

 It works fine if I use /usr/bin/python instead, but that isn't an
 option because this needs to be able to run on OS 10.4, which has
 Python 2.3 (which chokes on an import in py2app).  Am I doing
 something wrong, or is this a bug?

 thanks,
 Nat
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG