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..