You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pylucene-dev@lucene.apache.org by Bill Janssen <ja...@parc.com> on 2010/04/12 20:48:51 UTC

jcc version string?

It would be helpful to have a variable jcc.VERSION initialized with the
jcc version, either as a string or a tuple sequence.

Bill

Re: jcc version string?

Posted by Bill Janssen <ja...@parc.com>.
By the way, I'm still getting build failures on the PyLucene trunk on OS
X 10.5 with the latest Java compiler:

[...]
common.compile-core:

compile-core:

compile-test:
    [mkdir] Created dir: /private<http://buildbot.parc.xerox.com/job/leopard-pylucene-test/ws/pylucene/trunk/lucene-java-3.1/build/classes/test>
    [javac] Compiling 248 source files to /private<http://buildbot.parc.xerox.com/job/leopard-pylucene-test/ws/pylucene/trunk/lucene-java-3.1/build/classes/test>
    [javac] An exception has occurred in the compiler (1.5.0_16). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport)  after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report.  Thank you.
    [javac] java.lang.AssertionError: {unused}
    [javac] 	at com.sun.tools.javac.tree.TreeMaker$AnnotationBuilder.visitArray(TreeMaker.java:634)
    [javac] 	at com.sun.tools.javac.code.Attribute$Array.accept(Attribute.java:124)
    [javac] 	at com.sun.tools.javac.tree.TreeMaker$AnnotationBuilder.translate(TreeMaker.java:637)
    [javac] 	at com.sun.tools.javac.tree.TreeMaker$AnnotationBuilder.visitCompoundInternal(TreeMaker.java:628)
    [javac] 	at com.sun.tools.javac.tree.TreeMaker$AnnotationBuilder.translate(TreeMaker.java:641)
    [javac] 	at com.sun.tools.javac.tree.TreeMaker.Annotation(TreeMaker.java:649)
    [javac] 	at com.sun.tools.javac.tree.TreeMaker.Annotations(TreeMaker.java:570)
    [javac] 	at com.sun.tools.javac.tree.TreeMaker.VarDef(TreeMaker.java:554)
    [javac] 	at com.sun.tools.javac.comp.Lower.visitIterableForeachLoop(Lower.java:2892)
    [javac] 	at com.sun.tools.javac.comp.Lower.visitForeachLoop(Lower.java:2755)
[...]

Might be something to be aware of, though it looks like it's an
Oracle/Apple bug rather than a PyLucene bug.  Or maybe Lucene doesn't
compile with Java 1.5 any more.

Bill

Re: jcc version string?

Posted by Andi Vajda <va...@apache.org>.
On Mon, 12 Apr 2010, Bill Janssen wrote:

> Andi Vajda <va...@apache.org> wrote:
>
>>> Well, that's good.  What about JCC itself?  I'd like something like
>>>
>>>>>> import jcc
>>>>>> jcc.VERSION
>>> '2.5.1'
>>>>>>
>>>
>>> Or
>>>
>>>>>> import jcc
>>>>>> jcc.VERSION
>>> (2, 5, 1)
>>>>>>
>>>
>>> The second form would be more generally useful, I think.
>>
>> There only is a jcc module at runtime on Windows and then only when
>> shared mode is used.
>
> Huh?  So what's this?
>
> % python
> Python 2.5.1 (r251:54863, Feb  6 2009, 19:02:12)
> [GCC 4.0.1 (Apple Inc. build 5465)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
>>>> import sys
>>>> sys.platform
> 'darwin'
>>>> import jcc
>>>>
>
> Are you saying that jcc need not be installed for PyLucene to be
> installed?  Sure, that's fine.  I'm actually thinking about the case
> where jcc is being used to wrap some other library, so in that case
> jcc might be there but not lucene.

I'm saying that there are two situations where a jcc module may exist in 
your Python VM:
   1. at compile time, when you can get VERSION ouf of jcc.config
   2. at runtime, where there is no jcc module loaded for you into the
      Python VM unless you do it or you're on Windows and are using shared
      mode. JCC_VERSION is available from any module that you've built
      with JCC regardless of these caveats.

As I'm writing these words, I just realized that's not the case in what I 
committed earlier today. It's only in the first module thus imported.
I'm fixing this...

Andi..

Re: jcc version string?

Posted by Bill Janssen <ja...@parc.com>.
Andi Vajda <va...@apache.org> wrote:

> > Well, that's good.  What about JCC itself?  I'd like something like
> >
> >>>> import jcc
> >>>> jcc.VERSION
> > '2.5.1'
> >>>>
> >
> > Or
> >
> >>>> import jcc
> >>>> jcc.VERSION
> > (2, 5, 1)
> >>>>
> >
> > The second form would be more generally useful, I think.
>
> There only is a jcc module at runtime on Windows and then only when
> shared mode is used.

Huh?  So what's this?

% python
Python 2.5.1 (r251:54863, Feb  6 2009, 19:02:12) 
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.platform
'darwin'
>>> import jcc
>>>

Are you saying that jcc need not be installed for PyLucene to be
installed?  Sure, that's fine.  I'm actually thinking about the case
where jcc is being used to wrap some other library, so in that case
jcc might be there but not lucene.

> But I could also write this into config.py so
> that when JCC itself is run one also has access to the VERSION:
> 
>    >>> from jcc.config import VERSION
>    >>> VERSION
>    '2.5'
> 
> Andi..

That'll work.

Bill

Re: jcc version string?

Posted by Andi Vajda <va...@apache.org>.
On Mon, 12 Apr 2010, Bill Janssen wrote:

> Andi Vajda <va...@apache.org> wrote:
>
>> On Mon, 12 Apr 2010, Bill Janssen wrote:
>>
>>> Andi Vajda <va...@apache.org> wrote:
>>>
>>>>
>>>> On Mon, 12 Apr 2010, Bill Janssen wrote:
>>>>
>>>>> It would be helpful to have a variable jcc.VERSION initialized with the
>>>>> jcc version, either as a string or a tuple sequence.
>>>>
>>>> The following is already available. Is it good enough ?
>>>>
>>>>  >>> from pkg_resources import require
>>>>  >>> require('jcc')
>>>> [JCC 2.5 (/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/JCC-2.5-py2.6-macosx-10.6-x86_64.egg)]
>>>>  >>> require('jcc')[0].parsed_version
>>>> ('00000002', '00000005', '*final')
>>>
>>> I believe this is another setuptools thing.  So, not really -- what if
>>> you didn't use setuptools?
>>
>> Ah yes, that could be.
>> Anyhow, I added a JCC_VERSION string to the modules using JCC. That
>> string is the same as the version string, jcc_ver, used in JCC's
>> setup.py.
>>
>>   >>> import lucene
>>   >>> lucene.VERSION
>>    '3.1'
>>   >>> lucene.JCC_VERSION
>>    '2.5'
>>
>> Andi..
>
> Well, that's good.  What about JCC itself?  I'd like something like
>
>>>> import jcc
>>>> jcc.VERSION
> '2.5.1'
>>>>
>
> Or
>
>>>> import jcc
>>>> jcc.VERSION
> (2, 5, 1)
>>>>
>
> The second form would be more generally useful, I think.

There only is a jcc module at runtime on Windows and then only when shared 
mode is used. But I could also write this into config.py so that when JCC 
itself is run one also has access to the VERSION:

    >>> from jcc.config import VERSION
    >>> VERSION
    '2.5'

Andi..

Re: jcc version string?

Posted by Bill Janssen <ja...@parc.com>.
Andi Vajda <va...@apache.org> wrote:

> On Mon, 12 Apr 2010, Bill Janssen wrote:
> 
> > Andi Vajda <va...@apache.org> wrote:
> >
> >>
> >> On Mon, 12 Apr 2010, Bill Janssen wrote:
> >>
> >>> It would be helpful to have a variable jcc.VERSION initialized with the
> >>> jcc version, either as a string or a tuple sequence.
> >>
> >> The following is already available. Is it good enough ?
> >>
> >>   >>> from pkg_resources import require
> >>   >>> require('jcc')
> >> [JCC 2.5 (/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/JCC-2.5-py2.6-macosx-10.6-x86_64.egg)]
> >>   >>> require('jcc')[0].parsed_version
> >> ('00000002', '00000005', '*final')
> >
> > I believe this is another setuptools thing.  So, not really -- what if
> > you didn't use setuptools?
> 
> Ah yes, that could be.
> Anyhow, I added a JCC_VERSION string to the modules using JCC. That
> string is the same as the version string, jcc_ver, used in JCC's
> setup.py.
> 
>    >>> import lucene
>    >>> lucene.VERSION
>    '3.1'
>    >>> lucene.JCC_VERSION
>    '2.5'
> 
> Andi..

Well, that's good.  What about JCC itself?  I'd like something like

>>> import jcc
>>> jcc.VERSION
'2.5.1'
>>>

Or

>>> import jcc
>>> jcc.VERSION
(2, 5, 1)
>>>

The second form would be more generally useful, I think.

Bill

Re: jcc version string?

Posted by Andi Vajda <va...@apache.org>.
On Mon, 12 Apr 2010, Bill Janssen wrote:

> Andi Vajda <va...@apache.org> wrote:
>
>>
>> On Mon, 12 Apr 2010, Bill Janssen wrote:
>>
>>> It would be helpful to have a variable jcc.VERSION initialized with the
>>> jcc version, either as a string or a tuple sequence.
>>
>> The following is already available. Is it good enough ?
>>
>>   >>> from pkg_resources import require
>>   >>> require('jcc')
>> [JCC 2.5 (/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/JCC-2.5-py2.6-macosx-10.6-x86_64.egg)]
>>   >>> require('jcc')[0].parsed_version
>> ('00000002', '00000005', '*final')
>
> I believe this is another setuptools thing.  So, not really -- what if
> you didn't use setuptools?

Ah yes, that could be.
Anyhow, I added a JCC_VERSION string to the modules using JCC. That string 
is the same as the version string, jcc_ver, used in JCC's setup.py.

    >>> import lucene
    >>> lucene.VERSION
    '3.1'
    >>> lucene.JCC_VERSION
    '2.5'

Andi..

Re: jcc version string?

Posted by Bill Janssen <ja...@parc.com>.
Andi Vajda <va...@apache.org> wrote:

> 
> On Mon, 12 Apr 2010, Bill Janssen wrote:
> 
> > It would be helpful to have a variable jcc.VERSION initialized with the
> > jcc version, either as a string or a tuple sequence.
> 
> The following is already available. Is it good enough ?
> 
>    >>> from pkg_resources import require
>    >>> require('jcc')
> [JCC 2.5 (/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/JCC-2.5-py2.6-macosx-10.6-x86_64.egg)]
>    >>> require('jcc')[0].parsed_version
> ('00000002', '00000005', '*final')

I believe this is another setuptools thing.  So, not really -- what if
you didn't use setuptools?

Bill

Re: jcc version string?

Posted by Andi Vajda <va...@apache.org>.
On Mon, 12 Apr 2010, Bill Janssen wrote:

> It would be helpful to have a variable jcc.VERSION initialized with the
> jcc version, either as a string or a tuple sequence.

The following is already available. Is it good enough ?

    >>> from pkg_resources import require
    >>> require('jcc')
[JCC 2.5 (/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/JCC-2.5-py2.6-macosx-10.6-x86_64.egg)]
    >>> require('jcc')[0].parsed_version
('00000002', '00000005', '*final')

Andi..