def _next_version(version):
 if hasattr(version, 'base_version'):
  if version.base_version:
   parts = version.base_version.split('.')
  else:
   parts = []
 else:
  parts = []
  for part in version:
   if part.startswith('*'):
    break
   parts.append(part)
 parts = [int(p) for p in parts]
 if (len(parts) < 3):
  parts += ([0] * (3 - len(parts)))
 (major, minor, micro) = parts[:3]
 return '{0}.{1}.{2}'.format(major, (minor + 1), 0)

def _next_version ( version ) : if hasattr ( version , 'base_version' ) : if version . base_version : parts = version . base_version . split ( '.' ) else : parts = [ ] else : parts = [ ] for part in version : if part . startswith ( '*' ) : break parts . append ( part ) parts = [ int ( p ) for p in parts ] if ( len ( parts ) < 3 ) : parts += ( [ 0 ] * ( 3 - len ( parts ) ) ) ( major , minor , micro ) = parts [ : 3 ] return '{0}.{1}.{2}' . format ( major , ( minor + 1 ) , 0 )
given a parsed version from pkg_resources .