"""Checks that the version of the projects bundled in ensurepip are the latestversions available."""importensurepipimportjsonimporturllib.requestimportsysdefmain():outofdate=Falseforproject,versioninensurepip._PROJECTS:data=json.loads(urllib.request.urlopen("https://pypi.python.org/pypi/{}/json".format(project),cadefault=True,).read().decode("utf8"))upstream_version=data["info"]["version"]ifversion!=upstream_version:outofdate=Trueprint("The latest version of {} on PyPI is {}, but ensurepip ""has {}".format(project,upstream_version,version))ifoutofdate:sys.exit(1)if__name__=="__main__":main()