Differences between revisions 19 and 21 (spanning 2 versions)
Revision 19 as of 2007-12-26 01:03:11
Size: 2253
Editor: PhilipJenvey
Comment: sys.executable support
Revision 21 as of 2007-12-29 01:40:13
Size: 2598
Editor: PhilipJenvey
Comment: update likely order in which i'll attack these, lstat updates
Deletions are marked like this. Additions are marked like this.
Line 17: Line 17:

We don't have:
 * a site-packages dir (jython needs to include it on sys.path by default). required by setuptools and distutils '''''Added in r3886'''''
Line 22: Line 21:
  - distutils metadata for the os.name == 'java' (like path names, default bdist type, etc)   * a valid sys.executable '''''Added in r3867'''''

  * getpass module '''''Added in r3876'''''

  *
distutils metadata for the os.name == 'java' (like path names, default bdist type, etc)
Line 24: Line 27:
  - a jython spawn-like function: "error: don't know how to spawn programs on platform 'java'". os.system works as a replacement   * a jython spawn-like function: "error: don't know how to spawn programs on platform 'java'". os.system works as a replacement
Line 26: Line 29:
  - a valid sys.executable '''''Added in r3867'''''   * compile .py files to $py.class instead of .pyc '''''distutils and these last 3 modifications were added in r3888'''''
Line 28: Line 31:
  - compile .py files to $py.class instead of .pyc

 * working marshal? setuptools uses marshal.load in a couple places, which either needs to be avoided or possibly some work done to Jython's marshal module
    
 * imp.acquire/release_lock
  This is just a simple lock, but probably needs to be used by internal imp operations. I'm not sure
We don't have:
Line 39: Line 37:
 * a site-packages dir (jython needs to include it on sys.path by default)  * imp.acquire/release_lock
  This is just a simple lock, but probably needs to be used by internal imp operations. I'm not sure
Line 43: Line 42:
 * os.lstat. setuptools cut and pasted shutil's rmtree from CPython 2.3, which uses lstat to check for directories. We can support an os.stat that fills in st_mode's directory bit, but can we do lstat (we could with JNA)? We may want to submit a patch to setuptools to avoid lstat (it could avoid it if it used os.path.isdir)  * os.lstat. setuptools cut and pasted shutil's rmtree from CPython 2.3, which uses lstat to check for a directory vs a symlink to a directory. We now support an os.stat that fills in st_mode's directory bit, but can we support lstat? (We definitely can with JNA)? Can setuptools avoid lstat completely (requiring a patch)? I don't think Java can safely determine a sym link yet. Java 1.7's JSR 203 (nio part 2) should address this as well as chmod, but we obviously need a solution for Java 1.5

 * working marshal? setuptools uses marshal.load in a couple places, which either needs to be avoided or possibly some work done to Jython's marshal module

Setuptools requirements:

  • PEP 302 style zipimport module Added in r3463

  • number of misc. Jython bug fixes most already committed

  • file descriptor support for tempfile.mkstemp, os.open and tarfile Added in r3711

  • tempfile.mkstemp Added in r3712

  • os.chdir (also needed for distutils) Added in r3844

  • tarfile module Added in r3850

  • a valid sys.executable. required by setuptools and distutils for spawning subprocesses. Added in r3867, enabled via -Dpython.executable (see http://article.gmane.org/gmane.comp.lang.jython.devel/4068 )

  • a site-packages dir (jython needs to include it on sys.path by default). required by setuptools and distutils Added in r3886

  • distutils: requires [http://hg.underboss.org/jython-pjenvey/rev/1026fe32c01c a number of small patches]:

    • a valid sys.executable Added in r3867

    • getpass module Added in r3876

    • distutils metadata for the os.name == 'java' (like path names, default bdist type, etc)
    • a jython spawn-like function: "error: don't know how to spawn programs on platform 'java'". os.system works as a replacement
    • compile .py files to $py.class instead of .pyc distutils and these last 3 modifications were added in r3888

We don't have:

  • setuptools runs a test to ensure .pth files work by running "sys.executable -E -c pass". -E is ignore environment on CPython, but is different on Jython (takes an argument):
    • -E codec : Use a different codec the reading from the console.
  • imp.acquire/release_lock
    • This is just a simple lock, but probably needs to be used by internal imp operations. I'm not sure
  • os.chmod. This can be implemented with JNA. We can still support setuptools on deployments lacking JNA if we submit a patch back to setuptools to only use chmod if it exists
  • os.lstat. setuptools cut and pasted shutil's rmtree from CPython 2.3, which uses lstat to check for a directory vs a symlink to a directory. We now support an os.stat that fills in st_mode's directory bit, but can we support lstat? (We definitely can with JNA)? Can setuptools avoid lstat completely (requiring a patch)? I don't think Java can safely determine a sym link yet. Java 1.7's JSR 203 (nio part 2) should address this as well as chmod, but we obviously need a solution for Java 1.5
  • working marshal? setuptools uses marshal.load in a couple places, which either needs to be avoided or possibly some work done to Jython's marshal module

SetuptoolsOnJython (last edited 2010-01-02 16:58:16 by AndrewKuchling)