On Fri, Oct 16, 2009 at 9:07 AM, Jason S. <[email protected]> wrote: > I just did a fresh pip install of Pylons and looked over the Paste > stuff, and it looks like there is a .pth file that comes with each > Paste package (ending with the string "nspkg.pth") that contains > executable Python (!) (I didn't know pth files could have code in > them) that jiggles with the path. Weird stuff. Anyway, it wouldn't > work without those pth files, or, as you noted, simply adding an > __init__.py to paste/
Here comes yet another approach to Pylons on GAE problem, without virtualenv: 1. Write a script, to analysis dependencies of the working Pylons project (via setup.py or .egg-info dir), and gather all the dependencies of dependencies, recursively. 2. ln -s (or copy) all the dependencies python package to the root dir, so that GAE can import them. 3. If the dependence package has a .pth associated with it, append its content to a module located in the GAE app root dir (the same dir with app.yaml), named pthes.py. At the beginning of runner.py, import pthes. So that the paste package without __init__.py can be imported, because its .pth appended 'paste' dir in sys.path. 4. ln -s (or copy) all the dependencies .egg-info dir to the root dir, so that pkg_resource.load_entry_point could work. 5. (optional) To avoid .egg-info dirs take too much quote of file count, we can package (and compress) all of them into a single file, e.g. a tar.gz file or a pickle file, and patch pkg_resource to know how to read original entry_points.txt from that file. Add some cache mechanism if need. This approach makes all the pkg_resource needed information available in GAE environment, so that no any further modification needed for the Pylons package or project, including the .ini file. As I'm not a setuptools guru, I'd like to hear some opinions on it or suggestions before get hands dirty. -- Qiangning Hong --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~----------~----~----~----~------~----~------~--~---
