Differences between revisions 8 and 15 (spanning 7 versions)
Revision 8 as of 2007-09-01 00:49:38
Size: 1626
Editor: PhilipJenvey
Comment: latest updates
Revision 15 as of 2007-12-09 21:20:29
Size: 2624
Editor: PhilipJenvey
Comment: we now have file descriptors and mkstemp, update status
Deletions are marked like this. Additions are marked like this.
Line 7: Line 7:
 * file descriptor support for tempfile.mkstemp and os.open ''''''Added in r3711''''''
  
 * tempfile.mkstemp ''''''Added in r3712''''''
Line 9: Line 13:
 * tarfile module. This requires a small patch to PyString to work  * the kicker, a working os.chdir. I hacked together [http://hg.underboss.org/jython-pjenvey/rev/51246729a616 a really quick version of this ], and setuptools was able to get pretty far at installing Pylons. Pylons itself and a number of its dependencies installed fine, but the process died installing the decorator module due to marshal raising a KeyError
 
 * working marshal. setuptools uses marshal.load, and there's some bugs with our current marshaller

 * tarfile module. This requires [http://hg.underboss.org/jython-pjenvey/rev/3507a9b953fa a small patch to PyString] to work for setuptools. I believe it may require some additions to the os module for test_tarfile.py to pass
Line 13: Line 21:
 * distutils: requires a number of small patches:  * distutils: requires [http://hg.underboss.org/jython-pjenvey/rev/1026fe32c01c a number of small patches]:
Line 20: Line 28:
    * tempfile.mkstemp
  - I have patch #1783692 implementing mkstemp/NamedTemporaryFile with Java's secure File.createTempFile
Line 25: Line 30:
  This is just a simple lock, but may have to be called by internal imp operations. I'm not sure   This is just a simple lock, but may have to be used by internal imp operations. I'm not sure
  
 * 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.
   
 * a site-packages dir (jython needs to include it on sys.path by default)
Line 27: Line 38:
 * A few small upstream patches to setuptools, this includes:
 
  - use tempfile.NamedTemporaryFile instead of tempfile.mkstemp (Java/Jython doesn't allow usage of file descriptors). This will also remove a usage of os.open
 * 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
Possibly a small upstream patch to setuptools, this includes so far:
Line 31: Line 41:
  - wrap uses of os.chmod in hasattr(os, 'chmod')
  
  - sandbox may assume os.open (and maybe others) exist
  
  - setuptools cut and pasted shutil's rmtree from CPython 2.3, which uses lstat to check for directories. This may need to change to os.path.isdir (Jython might be able to do lstat, though)
 * 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 what about lstat? We may want to submit a patch to setuptools to avoid lstat

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 and os.open Added in r3711

  • tempfile.mkstemp Added in r3712

We don't have:

  • the kicker, a working os.chdir. I hacked together [http://hg.underboss.org/jython-pjenvey/rev/51246729a616 a really quick version of this ], and setuptools was able to get pretty far at installing Pylons. Pylons itself and a number of its dependencies installed fine, but the process died installing the decorator module due to marshal raising a KeyError

  • working marshal. setuptools uses marshal.load, and there's some bugs with our current marshaller
  • tarfile module. This requires [http://hg.underboss.org/jython-pjenvey/rev/3507a9b953fa a small patch to PyString] to work for setuptools. I believe it may require some additions to the os module for test_tarfile.py to pass

  • a valid sys.executable. required by setuptools and distutils for spawning subprocesses. It's impossible to determine argv[0] from java: I'm thinking the jython executable should pass this information along to Jython (java -Dpython.executable=$0)
  • distutils: requires [http://hg.underboss.org/jython-pjenvey/rev/1026fe32c01c a number of small patches]:

    • - 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 - a valid sys.executable
  • imp.acquire/release_lock
    • This is just a simple lock, but may have to be used by internal imp operations. I'm not sure
  • 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.
  • a site-packages dir (jython needs to include it on sys.path by default)
  • 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

Possibly a small upstream patch to setuptools, this includes so far:

  • 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 what about lstat? We may want to submit a patch to setuptools to avoid lstat

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