Edgewall Software

Ticket #103 (closed defect: fixed)

Opened 7 years ago

Last modified 3 years ago

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__'
>>>

Attachments

Change History

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

Changed 7 years ago by cmlenz

  • status changed from new to closed
  • resolution set to fixed

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

Add/Change #103 (Genshi doesn't export version information)

Author


E-mail address and user name can be saved in the Preferences.


Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.