[Distutils] setuptools on jython
Philip Jenvey
pjenvey at groovie.org
Sun Jan 13 02:57:48 CET 2008
On Jan 11, 2008, at 8:51 PM, Phillip J. Eby wrote:
> At 07:57 PM 1/11/2008 -0800, Philip Jenvey wrote:
>> Jython trunk has made a lot of progress on setuptools support. The
>> gory details are here:
>>
>> http://wiki.python.org/jython/SetuptoolsOnJython
>
> By the way, the reason setuptools uses -E for the subprocess is so
> that Python will ignore any environment variables such as
> PYTHONPATH et al. It's not clear to me whether making -E a no-op
> for Jython will actually make this work correctly.
Right, Jython doesn't support environment variables (a historical
thing) -- its equivalent is the 'registry', a java properties file. I
actually held off on having -E disable the registry because I have a
feeling there could be evil repercussions, like jython not working at
all in some environments. I have to investigate more before going
that route.
> I also have some concerns about how the $py.class stuff will work
> with distutils in general as well as setuptools in particular, but
> I've tried as much as possible to make setuptools follow the
> distutils rather than do its own thing. So hopefully most of the
> relevant things will be taken care of by Jython-level distutils
> patches.
>
distutils support was just recently added, specifically for
setuptools =]. It probably has some rough edges still -- but I'm
thinking setuptools will be in pretty good shape after these two
patches.
>
>> o to find un-zip_safe variables/calls when a distribution doesn't
>> specify zip_safetyness. Probably the easiest way to deal with this is
>> to just fallback to zip_safe=False on these platforms
>
> That's probably reasonable. An alternative would be to use the
> tokenize module to read the source code, since all it really does
> is look at name tokens and string constants, which can both be
> identified via tokenization without any higher-level parsing.
>
There's always the rare case of an egg containing only byte code,
though. Not that I've ever seen eggs like this, but I've heard talk
of them before.
Attached is a simple patch to disable the zip_safe scan on Jython/
IronPython. Maybe in the future we can use tokenize when all of the
source code is present in an archive.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jython_zip_safe-r59934.diff
Type: application/octet-stream
Size: 978 bytes
Desc: not available
Url : http://mail.python.org/pipermail/distutils-sig/attachments/20080112/235e8f96/attachment.obj
-------------- next part --------------
--
Philip Jenvey
More information about the Distutils-SIG
mailing list