def get_version(module_name_or_file=None):
    """Return the current version as defined by the given module/file."""

    if module_name_or_file is None:
        parts = base_module.split('.')
        module_name_or_file = parts[0] if len(parts) > 1 else \
            find_packages(exclude=['test', 'test.*'])[0]

    if os.path.isdir(module_name_or_file):
        module_name_or_file = os.path.join(module_name_or_file, '__init__.py')

    with open(module_name_or_file, 'r') as f:
        match = VERSION_PATTERN.search(f.read())
        return match.group(1)
def get_version ( module_name_or_file = None ) : if module_name_or_file is None : parts = base_module . split ( '.' ) module_name_or_file = parts [ 0 ] if len ( parts ) > 1 else find_packages ( exclude = [ 'test' , 'test.*' ] ) [ 0 ] if os . path . isdir ( module_name_or_file ) : module_name_or_file = os . path . join ( module_name_or_file , '__init__.py' ) with open ( module_name_or_file , 'r' ) as f : match = VERSION_PATTERN . search ( f . read ( ) ) return match . group ( 1 )
Return the current version as defined by the given module/file.