def _resolve_version(version):
 if (version is not LATEST):
  return version
 resp = urlopen('https://pypi.python.org/pypi/setuptools/json')
 with contextlib.closing(resp):
  try:
   charset = resp.info().get_content_charset()
  except Exception:
   charset = 'UTF-8'
  reader = codecs.getreader(charset)
  doc = json.load(reader(resp))
 return str(doc['info']['version'])

def _resolve_version ( version ) : if ( version is not LATEST ) : return version resp = urlopen ( 'https://pypi.python.org/pypi/setuptools/json' ) with contextlib . closing ( resp ) : try : charset = resp . info ( ) . get_content_charset ( ) except Exception : charset = 'UTF-8' reader = codecs . getreader ( charset ) doc = json . load ( reader ( resp ) ) return str ( doc [ 'info' ] [ 'version' ] )
resolve latest version .