import pkg_resources

version = pkg_resources.require(__name__)[0].version

def greet(name='World'):
    print "Hi, %s! -- from version %s of %s" % (name, version, __name__)

import pkg_resources

try: version = pkg_resources.require(__name__)[0].version
except: version = 'unknown'

def greet(name='World'):
    print "Hi, %s! -- from version %s of %s" % (name, version, __name__)

Allow 'hello' test package to be used unpackaged
Allow 'hello' test package to be used unpackaged
