Edgewall Software

Opened 17 years ago

Closed 17 years ago

Last modified 13 years ago

#103 closed defect (fixed)

Genshi doesn't export version information

Reported by: techie Owned by: cmlenz
Priority: trivial Milestone: 0.4
Component: General Version: 0.3.6
Keywords: Cc:

Description

>>> import genshi
>>> genshi.__version__
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
AttributeError: 'module' object has no attribute '__version__'
>>>

Change History (2)

comment:1 Changed 17 years ago by cmlenz

If you have setuptools, and have installed Genshi using setuptools (which is the default when setuptools is found when you run setup.py), you can do:

import pkg_resources
pkg_resources.get_distribution('Genshi').version

This could probably be done in __init__.py, but I'm not sure what to do when Genshi is installed without setuptools—which is still an option.

comment:2 Changed 17 years ago by cmlenz

  • Resolution set to fixed
  • Status changed from new to closed

[516] adds the __version__ attribute for a setuptools-based install. I don't really want to have multiple places to change the version number, so this will have to do for now.

Note: See TracTickets for help on using tickets.