Differences between revisions 1 and 6 (spanning 5 versions)
Revision 1 as of 2007-09-23 20:34:36
Size: 1410
Editor: PhilipJenvey
Comment: Pylons on jython! the current state of affairs
Revision 6 as of 2008-01-15 23:36:09
Size: 2476
Editor: PhilipJenvey
Comment: update nose
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
The things/steps needed to get Pylons running on Jython: #format rst

Getting Pylons (0.9.6.1) to run on Jython
=========================================
Line 5: Line 8:
  - distutils and setuptools (See SetuptoolsOnJython)   * distutils and setuptools (Mostly finished, See `SetuptoolsOnJython`_)
Line 9: Line 12:
* nose. Pylons projects require nose, but most packages (including Pylons) use nose as their own test runners.

  requires:

  - the optparse module (added in r4018)

  - compiler modules (compiler requires the parser module which Jython lacks). nose only needs the compiler module to use compiler.consts.CO_GENERATOR; until there's a parser, maybe jython could provide a broken compiler module that doesn't import parser

  - a fix for the cell variable (variables used in closures) bug here: http://pylonshq.com/pasties/667
Line 10: Line 23:

* Mako

  - mako uses the compiler module to parse Python code into AST. The compiler module is mostly pure Python code, but its guts are really the native parser module (which Jython lacks)

* Beaker
Line 13: Line 32:
  - (I actually tested routes on Jython over a year ago and all the tests passed after one small change)

* Beaker
  - I got all of routes' tests to pass on Jython well over a year ago so I don't expect too much trouble here -pjenvey
Line 23: Line 40:
  * `SetuptoolsOnJython`_ currently has trouble installing simplejson, because it attempts to compile its optional C extensions (that help performance). It expects to catch a distutils.errors.CCompilerError if the compilation fails, but Jython dies much earlier:

  File "/Users/pjenvey/src/java/jython-trunk/dist/Lib/distutils/command/build_ext.py", line 598, in get_ext_filename

  TypeError: cannot concatenate 'str' and 'NoneType' objects
Line 27: Line 50:
* nose
  - nose requires the optparse (easy) and the compiler module (sort of easy -- compiler requires the parser module, which isn't easy to get). nose only needs the compiler module to use compiler.consts.CO_GENERATOR, maybe jython could provide a broken compiler module that doesn't import parser.

* Mako
Line 34: Line 52:
* SQLAlchemy. The [http://www.sqlalchemy.org/trac/ticket/672 Dialect Refactor II] ticket will need to be implemented to properly support using SQLAlchemy via Jython's DBAPI jdbc driver, [http://jython.org/Project/userguide.html#database-connectivity-in-jython zxJDBC]. Frank Wierzbicki has done some preliminary work on using SQLAlchemy with Jython, info [http://groups.google.com/group/sqlalchemy/browse_frm/thread/d60db24fe1683a41/09320033f406d78b?hl=en&lnk=gst here] * SQLAlchemy

  -
The [http://www.sqlalchemy.org/trac/ticket/672 Dialect Refactor II] ticket will need to be implemented to properly support using SQLAlchemy via Jython's DBAPI jdbc driver, [http://jython.org/Project/userguide.html#database-connectivity-in-jython zxJDBC].
  -
Frank Wierzbicki has done some preliminary work on using SQLAlchemy with Jython, info [http://groups.google.com/group/sqlalchemy/browse_frm/thread/d60db24fe1683a41/09320033f406d78b?hl=en&lnk=gst here], and is scheduled to give a talk at PyCon 2008: "Database development with Jython, SQLAlchemy, and Hibernate"

Getting Pylons (0.9.6.1) to run on Jython

  • The ability to install Pylons and all its dependencies:

Ensure all dependencies' tests pass:

  • nose. Pylons projects require nose, but most packages (including Pylons) use nose as their own test runners.

    requires:

    • the optparse module (added in r4018)
    • compiler modules (compiler requires the parser module which Jython lacks). nose only needs the compiler module to use compiler.consts.CO_GENERATOR; until there's a parser, maybe jython could provide a broken compiler module that doesn't import parser
    • a fix for the cell variable (variables used in closures) bug here: http://pylonshq.com/pasties/667
  • Paste, PasteDeploy and PasteScript

  • Mako

    • mako uses the compiler module to parse Python code into AST. The compiler module is mostly pure Python code, but its guts are really the native parser module (which Jython lacks)
  • Beaker

  • Routes

    • I got all of routes' tests to pass on Jython well over a year ago so I don't expect too much trouble here -pjenvey
  • WebHelpers

  • FormEncode

  • simplejson

    • SetuptoolsOnJython currently has trouble installing simplejson, because it attempts to compile its optional C extensions (that help performance). It expects to catch a distutils.errors.CCompilerError if the compilation fails, but Jython dies much earlier:

    File "/Users/pjenvey/src/java/jython-trunk/dist/Lib/distutils/command/build_ext.py", line 598, in get_ext_filename

    TypeError: cannot concatenate 'str' and 'NoneType' objects

  • decorator

    • Note: decorators aren't currently supported in Jython, however the decorator module doesn't actually use decorators (works on CPython 2.3)

Later down the road:

PylonsOnJython (last edited 2009-09-14 22:04:24 by PhilipJenvey)