Opened 13 years ago

Closed 13 years ago

#3137 closed enhancement (fixed)

Add __version__ to python bindings

Reported by: ChrisBarker Owned by: hobu
Priority: normal Milestone: 1.6.3
Component: PythonBindings Version: unspecified
Severity: minor Keywords:


It's a pretty well supported convention now for Python modules to have a __version__ attribute that returns something meaningful. It would be nice if had a line:

__version__ = VersionInfo("RELEASE_NAME")


__version__ = _gdal.VersionInfo("RELEASE_NAME")

While we're at it, it might be nice for osgeo\ to have a __version__ defined as well.

Patch attached -- I don't know if it's right for the osgeo\ to poke into gdal to get a version number, but I didn't know how else to do it. It also may not be the best idea to to import _gdal there, as someone using just OGR may not want it imported.

It may be best to have the or Makefile dump a version number into the file at build time instead, but I'm not sure where it would come from.

I couldn't find any version info in OGR or OSR, so I haven't added anything for that.

Attachments (1)

version_diff.patch (790 bytes ) - added by ChrisBarker 13 years ago.
patch to add version attribute to

Download all attachments as: .zip

Change History (2)

by ChrisBarker, 13 years ago

Attachment: version_diff.patch added

patch to add version attribute to

comment:1 by hobu, 13 years ago

Resolution: fixed
Status: newclosed

Applied in trunk in r17634 and backported to the 1.6 branch in r17635

Note: See TracTickets for help on using tickets.