Re: [Pythonmac-SIG] py2app: How can I run tests using the bundled python interpreter?

2013-11-07 Thread Berg, Stuart
Hi Ronald,

 Recent versions of py2app have a way to specify secondary python scripts to 
 be included in the app bundle (the --extra-scripts option, introduced in 
 version 0.7). You could use that to include the test script in the app bundle 
 and launch it using the helper binary in ./dist/MyBundle.app/Contents/MacOS. 

The --extra-scripts option will satisfy my needs.  Thanks!  Somehow I 
overlooked this option when reading the documentation. I didn't understand what 
this option actually did.

 A helper script to launch a script with the right environment could also be 
 useful (that way you don't have to copy your script in the application 
 bundle). Could you file an issue about this in the py2app tracker 
 (https://bitbucket.org/ronaldoussoren/py2app/issues)?

Done!  (Issue #125)

Thanks for your help, and thanks for your great work on py2app!

Cheers,
Stuart

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


Re: [Pythonmac-SIG] py2app: How can I run tests using the bundled python interpreter?

2013-11-05 Thread Ronald Oussoren

On 1 Nov, 2013, at 21:10, Berg, Stuart be...@janelia.hhmi.org wrote:

 Hi all,
 
 I just posted a question about py2app to stackoverflow:
 http://stackoverflow.com/questions/19734558/py2app-how-can-i-run-tests-using-the-bundled-python-interpreter
 
 For your convenience, I've also pasted the question below.  Any responses 
 (via your preferred venue :-) are much appreciated.
 
 Many thanks,
 Stuart
 
 I use py2app to package my application.  A few quick notes about my app:
 
 - It uses a special python executable (i.e. non-system python), which py2app 
 includes in the bundle.
 - I explicitly exclude a few packages from site-packages.zip using the py2app 
 recipe feature.
 
 In the past, I've sometimes had issues with my app bundle because I forgot to 
 exclude certain packages from site-packages.zip.  This was easy to fix once I 
 discovered the problem, but I wasn't quick to discover it because the 
 packages in question *mostly* worked.  The problem only showed itself after 
 testing special cases that happen to exercise specific submodules in the 
 problematic dependency.
 
 In order to avoid problems like this in the future, I want to run a test 
 suite using the same exact interpreter that py2app includes in my bundle.  
 For that to work, I need the proper environment setup that is somehow 
 automatically created when the app starts up (including PYTHONPATH, 
 DYLD_LIBRARY_PATH, etc.).
 
 Just using ./dist/MyBundle.app/Contents/MacOS/python to run my tests doesn't 
 seem to do the trick.  What's the recommended method to run tests on the 
 fully built app bundle itself?

Recent versions of py2app have a way to specify secondary python scripts to be 
included in the app bundle (the --extra-scripts option, introduced in version 
0.7). You could use that to include the test script in the app bundle and 
launch it using the helper binary in ./dist/MyBundle.app/Contents/MacOS. 

A helper script to launch a script with the right environment could also be 
useful (that way you don't have to copy your script in the application bundle). 
Could you file an issue about this in the py2app tracker 
(https://bitbucket.org/ronaldoussoren/py2app/issues)?

Ronald

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

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


Re: [Pythonmac-SIG] py2app: How can I run tests using the bundled python interpreter?

2013-11-02 Thread Aahz
On Fri, Nov 01, 2013, Berg, Stuart wrote:
 
 In order to avoid problems like this in the future, I want to run a
 test suite using the same exact interpreter that py2app includes in my
 bundle.  For that to work, I need the proper environment setup that
 is somehow automatically created when the app starts up (including
 PYTHONPATH, DYLD_LIBRARY_PATH, etc.).

 Just using ./dist/MyBundle.app/Contents/MacOS/python to run my tests
 doesn't seem to do the trick.  What's the recommended method to run
 tests on the fully built app bundle itself?

Dunno about recommended but I just fiddled around until I got
PYTHONPATH etc set up correctly -- I think I may have created some fake
apps (using py2app) that dumped the env for debugging purposes.  This was
a couple of years ago in a previous job, so I don't have more details,
sorry.
-- 
Aahz (a...@pythoncraft.com)   * http://www.pythoncraft.com/

I don't long for a gender-free society, but I would dearly love one that
wasn't gender-*stupid*.  --Elise Matthesen
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
https://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: https://mail.python.org/mailman/options/Pythonmac-SIG


[Pythonmac-SIG] py2app: How can I run tests using the bundled python interpreter?

2013-11-01 Thread Berg, Stuart
Hi all,

I just posted a question about py2app to stackoverflow:
http://stackoverflow.com/questions/19734558/py2app-how-can-i-run-tests-using-the-bundled-python-interpreter

For your convenience, I've also pasted the question below.  Any responses (via 
your preferred venue :-) are much appreciated.

Many thanks,
Stuart

I use py2app to package my application.  A few quick notes about my app:

- It uses a special python executable (i.e. non-system python), which py2app 
includes in the bundle.
- I explicitly exclude a few packages from site-packages.zip using the py2app 
recipe feature.

In the past, I've sometimes had issues with my app bundle because I forgot to 
exclude certain packages from site-packages.zip.  This was easy to fix once I 
discovered the problem, but I wasn't quick to discover it because the packages 
in question *mostly* worked.  The problem only showed itself after testing 
special cases that happen to exercise specific submodules in the problematic 
dependency.

In order to avoid problems like this in the future, I want to run a test suite 
using the same exact interpreter that py2app includes in my bundle.  For that 
to work, I need the proper environment setup that is somehow automatically 
created when the app starts up (including PYTHONPATH, DYLD_LIBRARY_PATH, etc.).

Just using ./dist/MyBundle.app/Contents/MacOS/python to run my tests doesn't 
seem to do the trick.  What's the recommended method to run tests on the fully 
built app bundle itself?

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